ant-design/components/alert/demo/closable.tsx
kiner-tang(文辉) 827ada2da6
refactor(Alert): refactor closeIcon (#42962)
* refactor: refactor closeIcon

* feat: update test case

* feat: optimize code

* feat: remove demo about closeText

* feat: remove demo about closeText

* feat: optimize code

* feat: optimize code

* feat: optimize code

* feat: optimize code

* feat: optimize code

* feat: optimize code

* feat: optimize code

* feat: optimize code
2023-06-13 14:38:18 +08:00

27 lines
717 B
TypeScript

import { Alert, Space } from 'antd';
import React from 'react';
const onClose = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
console.log(e, 'I was closed.');
};
const App: React.FC = () => (
<Space direction="vertical" style={{ width: '100%' }}>
<Alert
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
closeIcon
onClose={onClose}
/>
<Alert
message="Error Text"
description="Error Description Error Description Error Description Error Description Error Description Error Description"
type="error"
closeIcon
onClose={onClose}
/>
</Space>
);
export default App;