File tree 3 files changed +32
-4
lines changed
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";
3
3
export * from "./components/Drawer" ;
4
4
export * from "./components/Dropdown" ;
5
5
export * from "./components/ExternalLink" ;
6
+ export * from "./components/GlobalInstances" ;
6
7
export * from "./components/Input" ;
7
8
export * from "./components/Label" ;
8
9
export * from "./components/Menu" ;
Original file line number Diff line number Diff line change 1
- import { ConfigProvider } from "antd" ;
1
+ import { App , ConfigProvider } from "antd" ;
2
2
import {
3
3
ALL_APPLICATIONS_URL ,
4
4
APP_EDITOR_URL ,
@@ -46,6 +46,7 @@ import { isFetchUserFinished } from "redux/selectors/usersSelectors";
46
46
import { SystemWarning } from "./components/SystemWarning" ;
47
47
import { getBrandingConfig , getSystemConfigFetching } from "./redux/selectors/configSelectors" ;
48
48
import { buildMaterialPreviewURL } from "./util/materialUtils" ;
49
+ import GlobalInstances from 'components/GlobalInstances' ;
49
50
50
51
const LazyUserAuthComp = React . lazy ( ( ) => import ( "pages/userAuth" ) ) ;
51
52
const LazyInviteLanding = React . lazy ( ( ) => import ( "pages/common/inviteLanding" ) ) ;
@@ -54,9 +55,17 @@ const LazyComponentPlayground = React.lazy(() => import("pages/ComponentPlaygrou
54
55
const LazyDebugComp = React . lazy ( ( ) => import ( "./debug" ) ) ;
55
56
const LazyDebugNewComp = React . lazy ( ( ) => import ( "./debugNew" ) ) ;
56
57
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
+ ) ;
60
69
61
70
type AppIndexProps = {
62
71
isFetchUserFinished : boolean ;
You can’t perform that action at this time.
0 commit comments