File tree Expand file tree Collapse file tree 3 files changed +32
-4
lines changed
Expand file tree Collapse file tree 3 files changed +32
-4
lines changed Original file line number Diff line number Diff line change 1+ import { App } from 'antd' ;
2+ import type { MessageInstance } from 'antd/es/message/interface' ;
3+ import type { ModalStaticFunctions } from 'antd/es/modal/confirm' ;
4+ import type { NotificationInstance } from 'antd/es/notification/interface' ;
5+
6+ let messageInstance : MessageInstance ;
7+ let notificationInstance : NotificationInstance ;
8+ let modalInstance : Omit < ModalStaticFunctions , 'warn' > ;
9+
10+ export default ( ) => {
11+ const staticFunction = App . useApp ( ) ;
12+ messageInstance = staticFunction . message ;
13+ modalInstance = staticFunction . modal ;
14+ notificationInstance = staticFunction . notification ;
15+ return null ;
16+ } ;
17+
18+ export { messageInstance , notificationInstance , modalInstance } ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ export * from "./components/CustomModal";
33export * from "./components/Drawer" ;
44export * from "./components/Dropdown" ;
55export * from "./components/ExternalLink" ;
6+ export * from "./components/GlobalInstances" ;
67export * from "./components/Input" ;
78export * from "./components/Label" ;
89export * from "./components/Menu" ;
Original file line number Diff line number Diff line change 1- import { ConfigProvider } from "antd" ;
1+ import { App , ConfigProvider } from "antd" ;
22import {
33 ALL_APPLICATIONS_URL ,
44 APP_EDITOR_URL ,
@@ -46,6 +46,7 @@ import { isFetchUserFinished } from "redux/selectors/usersSelectors";
4646import { SystemWarning } from "./components/SystemWarning" ;
4747import { getBrandingConfig , getSystemConfigFetching } from "./redux/selectors/configSelectors" ;
4848import { buildMaterialPreviewURL } from "./util/materialUtils" ;
49+ import GlobalInstances from 'components/GlobalInstances' ;
4950
5051const LazyUserAuthComp = React . lazy ( ( ) => import ( "pages/userAuth" ) ) ;
5152const LazyInviteLanding = React . lazy ( ( ) => import ( "pages/common/inviteLanding" ) ) ;
@@ -54,9 +55,17 @@ const LazyComponentPlayground = React.lazy(() => import("pages/ComponentPlaygrou
5455const LazyDebugComp = React . lazy ( ( ) => import ( "./debug" ) ) ;
5556const LazyDebugNewComp = React . lazy ( ( ) => import ( "./debugNew" ) ) ;
5657
57- const Wrapper = ( props : { children : React . ReactNode } ) => {
58- return < ConfigProvider locale = { getAntdLocale ( language ) } > { props . children } </ ConfigProvider > ;
59- } ;
58+ const Wrapper = ( props : { children : React . ReactNode } ) => (
59+ < ConfigProvider
60+ theme = { { hashed : false } }
61+ locale = { getAntdLocale ( language ) }
62+ >
63+ < App >
64+ < GlobalInstances />
65+ { props . children }
66+ </ App >
67+ </ ConfigProvider >
68+ ) ;
6069
6170type AppIndexProps = {
6271 isFetchUserFinished : boolean ;
You can’t perform that action at this time.
0 commit comments