-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { ConfigProvider } from 'antd'; | ||
import zhCN from 'antd/locale/zh_CN'; | ||
|
||
const RootContainer: React.FC<React.PropsWithChildren> = ({ children }) => ( | ||
<ConfigProvider | ||
locale={zhCN} | ||
theme={{ | ||
token: { | ||
// Seed Token,影响范围大 | ||
colorPrimary: '#00b96b', | ||
borderRadius: 18, | ||
|
||
// 派生变量,影响范围小 | ||
colorBgContainer: '#f6ffed', | ||
}, | ||
}} | ||
> | ||
{children} | ||
</ConfigProvider> | ||
); | ||
|
||
export default RootContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import { Button } from 'antd'; | ||
import { createModal } from 'create-antd-modal'; | ||
import RootContainer from './RootContainer'; | ||
|
||
const Demo: React.FC = () => { | ||
return ( | ||
<Button | ||
onClick={() => { | ||
createModal({ | ||
title: 'Some title', | ||
content: 'You can see that the i18n and theme configuration works now', | ||
container: RootContainer, | ||
}); | ||
}} | ||
> | ||
Custom Container | ||
</Button> | ||
); | ||
}; | ||
|
||
export default Demo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters