-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: update demo * feat: update app * feat: update app * feat: update app * feat: update app * Update index.tsx * feat: update doc * feat: update doc * feat: reset doc * feat: update doc * feat: merge feature * feat: update doc * feat: update cover img * feat: update doc * feat: update doc * feat: update doc * feat: update snapshots * feat: update doc Co-authored-by: lijianan <574980606@qq.com>
- Loading branch information
1 parent
17b5c36
commit 49e8c13
Showing
12 changed files
with
293 additions
and
185 deletions.
There are no files selected for viewing
80 changes: 42 additions & 38 deletions
80
components/app/__tests__/__snapshots__/demo-extend.test.ts.snap
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 |
---|---|---|
@@ -1,46 +1,50 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders ./components/app/demo/message.tsx extend context correctly 1`] = ` | ||
exports[`renders ./components/app/demo/basic.tsx extend context correctly 1`] = ` | ||
<div | ||
class="ant-app" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
<div | ||
class="ant-space ant-space-horizontal ant-space-align-center" | ||
> | ||
<span> | ||
Open message | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`renders ./components/app/demo/modal.tsx extend context correctly 1`] = ` | ||
<div | ||
class="ant-app" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open modal | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`renders ./components/app/demo/notification.tsx extend context correctly 1`] = ` | ||
<div | ||
class="ant-app" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open notification | ||
</span> | ||
</button> | ||
<div | ||
class="ant-space-item" | ||
style="margin-right:8px" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open message | ||
</span> | ||
</button> | ||
</div> | ||
<div | ||
class="ant-space-item" | ||
style="margin-right:8px" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open modal | ||
</span> | ||
</button> | ||
</div> | ||
<div | ||
class="ant-space-item" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open notification | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
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 |
---|---|---|
@@ -1,46 +1,50 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders ./components/app/demo/message.tsx correctly 1`] = ` | ||
exports[`renders ./components/app/demo/basic.tsx correctly 1`] = ` | ||
<div | ||
class="ant-app" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
<div | ||
class="ant-space ant-space-horizontal ant-space-align-center" | ||
> | ||
<span> | ||
Open message | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`renders ./components/app/demo/modal.tsx correctly 1`] = ` | ||
<div | ||
class="ant-app" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open modal | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`renders ./components/app/demo/notification.tsx correctly 1`] = ` | ||
<div | ||
class="ant-app" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open notification | ||
</span> | ||
</button> | ||
<div | ||
class="ant-space-item" | ||
style="margin-right:8px" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open message | ||
</span> | ||
</button> | ||
</div> | ||
<div | ||
class="ant-space-item" | ||
style="margin-right:8px" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open modal | ||
</span> | ||
</button> | ||
</div> | ||
<div | ||
class="ant-space-item" | ||
> | ||
<button | ||
class="ant-btn ant-btn-primary" | ||
type="button" | ||
> | ||
<span> | ||
Open notification | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
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,7 @@ | ||
## zh-CN | ||
|
||
获取 `message`,`notification`,`modal` 静态方法。 | ||
|
||
## en-US | ||
|
||
Static method for `message`,`notification`,`modal`. |
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,47 @@ | ||
import React from 'react'; | ||
import { App, Button, Space } from 'antd'; | ||
|
||
// Sub page | ||
const MyPage = () => { | ||
const { message, modal, notification } = App.useApp(); | ||
|
||
const showMessage = () => { | ||
message.success('Success!'); | ||
}; | ||
|
||
const showModal = () => { | ||
modal.warning({ | ||
title: 'This is a warning message', | ||
content: 'some messages...some messages...', | ||
}); | ||
}; | ||
|
||
const showNotification = () => { | ||
notification.info({ | ||
message: `Notification topLeft`, | ||
description: 'Hello, Ant Design!!', | ||
placement: 'topLeft', | ||
}); | ||
}; | ||
|
||
return ( | ||
<Space> | ||
<Button type="primary" onClick={showMessage}> | ||
Open message | ||
</Button> | ||
<Button type="primary" onClick={showModal}> | ||
Open modal | ||
</Button> | ||
<Button type="primary" onClick={showNotification}> | ||
Open notification | ||
</Button> | ||
</Space> | ||
); | ||
}; | ||
|
||
// Entry component | ||
export default () => ( | ||
<App> | ||
<MyPage /> | ||
</App> | ||
); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.