File tree 2 files changed +38
-16
lines changed
2 files changed +38
-16
lines changed Original file line number Diff line number Diff line change @@ -15,21 +15,32 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
15
15
function _taggedTemplateLiteral ( strings , raw ) { return Object . freeze ( Object . defineProperties ( strings , { raw : { value : Object . freeze ( raw ) } } ) ) ; }
16
16
17
17
var BaseAnimation = _styledComponents2 . default . div ( _templateObject , function ( props ) {
18
- return props . duration ? props . duration : '1s' ;
18
+ return props . duration ;
19
19
} , function ( props ) {
20
- return props . timingFunction ? props . timingFunction : 'ease' ;
20
+ return props . timingFunction ;
21
21
} , function ( props ) {
22
- return props . delay ? props . delay : '0s' ;
22
+ return props . delay ;
23
23
} , function ( props ) {
24
- return props . iterationCount ? props . iterationCount : '1' ;
24
+ return props . iterationCount ;
25
25
} , function ( props ) {
26
- return props . direction ? props . direction : 'normal' ;
26
+ return props . direction ;
27
27
} , function ( props ) {
28
- return props . fillMode ? props . fillMode : 'both' ;
28
+ return props . fillMode ;
29
29
} , function ( props ) {
30
- return props . playState ? props . playState : 'running' ;
30
+ return props . playState ;
31
31
} , function ( props ) {
32
- return props . inline ? 'inline-block' : 'initial' ;
32
+ return props . inline ;
33
33
} ) ;
34
34
35
+ BaseAnimation . defaultProps = {
36
+ duration : '1s' ,
37
+ timingFunction : 'ease' ,
38
+ delay : '0s' ,
39
+ iterationCount : '1' ,
40
+ direction : 'normal' ,
41
+ fillMode : 'both' ,
42
+ playState : 'running' ,
43
+ inline : 'initial'
44
+ } ;
45
+
35
46
exports . default = BaseAnimation ;
Original file line number Diff line number Diff line change 1
1
import styled from 'styled-components' ;
2
2
3
3
const BaseAnimation = styled . div `
4
- animation-duration: ${ props => props . duration ? props . duration : '1s' } ;
5
- animation-timing-function: ${ props => props . timingFunction ? props . timingFunction : 'ease' } ;
6
- animation-delay: ${ props => props . delay ? props . delay : '0s' } ;
7
- animation-iteration-count: ${ props => props . iterationCount ? props . iterationCount : '1' } ;
8
- animation-direction: ${ props => props . direction ? props . direction : 'normal' } ;
9
- animation-fill-mode: ${ props => props . fillMode ? props . fillMode : 'both' } ;
10
- animation-play-state: ${ props => props . playState ? props . playState : 'running' } ;
11
- display: ${ props => props . inline ? 'inline-block' : 'initial' } ;
4
+ animation-duration: ${ props => props . duration } ;
5
+ animation-timing-function: ${ props => props . timingFunction } ;
6
+ animation-delay: ${ props => props . delay } ;
7
+ animation-iteration-count: ${ props => props . iterationCount } ;
8
+ animation-direction: ${ props => props . direction } ;
9
+ animation-fill-mode: ${ props => props . fillMode } ;
10
+ animation-play-state: ${ props => props . playState } ;
11
+ display: ${ props => props . inline } ;
12
12
` ;
13
13
14
+ BaseAnimation . defaultProps = {
15
+ duration : '1s' ,
16
+ timingFunction : 'ease' ,
17
+ delay : '0s' ,
18
+ iterationCount : '1' ,
19
+ direction : 'normal' ,
20
+ fillMode : 'both' ,
21
+ playState : 'running' ,
22
+ inline : 'initial'
23
+ }
24
+
14
25
export default BaseAnimation ;
You can’t perform that action at this time.
0 commit comments