Skip to content

Commit

Permalink
Merge pull request #922 from southorange1228/fea/demo
Browse files Browse the repository at this point in the history
style(alert): 统一使用Space组件实现example
  • Loading branch information
honkinglin authored Jun 23, 2022
2 parents 697517e + 25ac904 commit b35a940
Show file tree
Hide file tree
Showing 8 changed files with 662 additions and 575 deletions.
1,185 changes: 635 additions & 550 deletions src/alert/__tests__/__snapshots__/alert.test.tsx.snap

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/alert/_example/base.jsx
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>
);
}
6 changes: 3 additions & 3 deletions src/alert/_example/close.jsx
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>
);
}
6 changes: 3 additions & 3 deletions src/alert/_example/icon.jsx
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>
);
}
6 changes: 3 additions & 3 deletions src/alert/_example/operation.jsx
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>
);
}
6 changes: 3 additions & 3 deletions src/alert/_example/swiper.jsx
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>
);
}
12 changes: 7 additions & 5 deletions src/alert/_example/title.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { Alert } from 'tdesign-react';

export default function AlertDescription() {
const operation = <span>相关操作</span>;
return (<Alert
message="这是一条普通的消息提示描述,这是一条普通的消息提示描述"
title="这是一条普通的消息提示"
operation={operation}
/>);
return (
<Alert
message="这是一条普通的消息提示描述,这是一条普通的消息提示描述"
title="这是一条普通的消息提示"
operation={operation}
/>
);
}
10 changes: 5 additions & 5 deletions test/ssr/__snapshots__/ssr.test.js.snap

Large diffs are not rendered by default.

0 comments on commit b35a940

Please sign in to comment.