-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathalert.tsx
59 lines (51 loc) · 1.01 KB
/
alert.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { default as AntAlert, AlertProps } from "antd/es/alert";
import styled from "styled-components";
const Container = styled.div`
display: block;
padding: 2px 0;
.ant-alert-warning {
border: none;
background: #fef7f1;
border-radius: 4px;
}
.ant-alert-error {
border: none;
background: #fff3f1;
border-radius: 4px;
}
.ant-alert-info {
border: none;
border-radius: 4px;
}
.ant-alert-success {
border: none;
border-radius: 4px;
}
.ant-alert {
padding: 0;
}
.ant-alert-icon {
margin-right: 4px;
margin-left: 8px;
}
.ant-alert-message {
font-size: 13px;
color: #333333;
line-height: 24px;
margin-left: 4px;
padding: 4px 0px;
}
`;
interface Iprops {
label: string;
}
export const Alert = (props: Iprops & AlertProps) => {
const { label, type, ...restProps } = props;
return (
<>
<Container>
<AntAlert message={label} type={type} showIcon={true} {...restProps} />
</Container>
</>
);
};