mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 11:40:04 +08:00
860e58ee6f
* Update closable.tsx Added `closable` prop Signed-off-by: Albert E. Hidalgo Taveras <35310226+itsalb3rt@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: afc163 <afc163@gmail.com> --------- Signed-off-by: Albert E. Hidalgo Taveras <35310226+itsalb3rt@users.noreply.github.com> Signed-off-by: afc163 <afc163@gmail.com> Co-authored-by: afc163 <afc163@gmail.com>
27 lines
715 B
TypeScript
27 lines
715 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"
|
|
closable
|
|
onClose={onClose}
|
|
/>
|
|
<Alert
|
|
message="Error Text"
|
|
description="Error Description Error Description Error Description Error Description Error Description Error Description"
|
|
type="error"
|
|
closable
|
|
onClose={onClose}
|
|
/>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|