-
Notifications
You must be signed in to change notification settings - Fork 0
/
styled-inner.ts
60 lines (58 loc) · 1.48 KB
/
styled-inner.ts
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
60
import styled, { css } from 'styled-components'
import { getStyle } from '../styled-components-layout'
import { translateOut, translateIn, animationStyle } from './animate-styled'
import { ModalInnerProps } from '../typings'
import { Button } from './styled-root-wrapper'
const modalType = {
danger: css`
background: #ff3547;
color: #fff;
${Button} {
background-color: transparent;
border: 2px solid #fff;
}
`,
success: css`
background: #00c851;
color: #fff;
${Button} {
background-color: transparent;
border: 2px solid #fff;
}
`,
primary: css`
background: #5bc0de;
color: #fff;
${Button} {
background-color: transparent;
border: 2px solid #fff;
}
`,
}
export const ModalInner = styled.div<ModalInnerProps>`
background: #fff;
padding: 20px 30px;
text-align: left;
width: 80%;
max-width: 650px;
position: relative;
border: 1px solid transparent;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
border-radius: 15px;
font-family: Roboto, sans-serif;
font-weight: 300;
line-height: 1.5rem;
font-size: 1rem;
margin: 0 auto;
animation-duration: ${({ closeTimeout }) =>
closeTimeout ? `${closeTimeout / 1000}s` : '0.4s'};
animation-name: ${({ isAnimated }) =>
isAnimated ? translateIn : translateOut};
${({ customStyle }) => customStyle}
${getStyle('type', modalType)}
${getStyle('animationName', animationStyle)}
${({ customAnimation }) =>
css`
${customAnimation}
`}
`