-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #922 from southorange1228/fea/demo
style(alert): 统一使用Space组件实现example
- Loading branch information
Showing
8 changed files
with
662 additions
and
575 deletions.
There are no files selected for viewing
1,185 changes: 635 additions & 550 deletions
1,185
src/alert/__tests__/__snapshots__/alert.test.tsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
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,13 +1,13 @@ | ||
import React from 'react'; | ||
import { Alert } from 'tdesign-react'; | ||
import { Alert, Space } from 'tdesign-react'; | ||
|
||
export default function AlertBase() { | ||
return ( | ||
<div className="tdesign-demo-block-column"> | ||
<Space direction="vertical"> | ||
<Alert theme="success" message="这是一条成功的消息提示" /> | ||
<Alert theme="info" message="这是一条普通的消息提示" /> | ||
<Alert theme="warning" message="这是一条警示消息" /> | ||
<Alert theme="error" message="高危操作/出错信息提示" /> | ||
</div> | ||
</Space> | ||
); | ||
} |
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,13 +1,13 @@ | ||
import React from 'react'; | ||
import { Alert } from 'tdesign-react'; | ||
import { Alert, Space } from 'tdesign-react'; | ||
|
||
export default function AlertClose() { | ||
return ( | ||
<div className="tdesign-demo-block-column"> | ||
<Space direction="vertical"> | ||
<Alert theme="success" message="这是一条成功的消息提示" close /> | ||
<Alert theme="info" message="这是一条普通的消息提示" close="关闭" /> | ||
<Alert theme="warning" message="这是一条警示消息" close="知道了" /> | ||
<Alert theme="error" message="高危操作/出错信息提示" close={<span>自定义关闭</span>} /> | ||
</div> | ||
</Space> | ||
); | ||
} |
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,13 +1,13 @@ | ||
import React from 'react'; | ||
import { Alert } from 'tdesign-react'; | ||
import { Alert, Space } from 'tdesign-react'; | ||
|
||
export default function AlertIcon() { | ||
return ( | ||
<div className="tdesign-demo-block-column"> | ||
<Space direction="vertical"> | ||
<Alert theme="success" message="这是一条成功的消息提示" /> | ||
<Alert theme="info" message="这是一条普通的消息提示" /> | ||
<Alert theme="warning" message="这是一条警示消息" /> | ||
<Alert theme="error" message="高危操作/出错信息提示" /> | ||
</div> | ||
</Space> | ||
); | ||
} |
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,14 +1,14 @@ | ||
import React from 'react'; | ||
import { Alert } from 'tdesign-react'; | ||
import { Alert, Space } from 'tdesign-react'; | ||
|
||
export default function AlertOperation() { | ||
const operation = <span>相关操作</span>; | ||
return ( | ||
<div className="tdesign-demo-block-column"> | ||
<Space direction="vertical"> | ||
<Alert theme="success" message="这是一条成功的消息提示" operation={operation} close /> | ||
<Alert theme="info" message="这是一条普通的消息提示" operation={operation} close /> | ||
<Alert theme="warning" message="这是一条警示消息" operation={operation} close /> | ||
<Alert theme="error" message="高危操作/出错信息提示" operation={operation} close /> | ||
</div> | ||
</Space> | ||
); | ||
} |
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,13 +1,13 @@ | ||
import React from 'react'; | ||
import { Alert } from 'tdesign-react'; | ||
import { Alert, Space } from 'tdesign-react'; | ||
|
||
export default function AlertBase() { | ||
return ( | ||
<div className="tdesign-demo-block-column"> | ||
<Space direction="vertical"> | ||
<Alert theme="success" message="这是一条成功的消息提示" /> | ||
<Alert theme="info" message="这是一条普通的消息提示" /> | ||
<Alert theme="warning" message="这是一条警示消息" /> | ||
<Alert theme="error" message="高危操作/出错信息提示" /> | ||
</div> | ||
</Space> | ||
); | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.