File tree Expand file tree Collapse file tree 5 files changed +19
-17
lines changed
Expand file tree Collapse file tree 5 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,19 @@ const fadeIn = keyframes`
1010 }
1111` ;
1212
13+ const mixin = css `
14+ opacity: 0;
15+ animation-name: ${ fadeIn } ;
16+ animation-timing-function: ease-in;
17+ animation-duration: 0.7s;
18+ animation-delay: 0s;
19+ animation-fill-mode: both;
20+ `
21+
1322const AnimatedDiv = styled . div `
1423 ${ ( { viewEnter } ) =>
15- viewEnter &&
16- css `
17- opacity: 0;
18- animation-name: ${ fadeIn } ;
19- animation-timing-function: ease-in;
20- animation-duration: 0.7s;
21- animation-delay: 0s;
22- animation-fill-mode: both;
23- ` } ;
24+ viewEnter && mixin
25+ }
2426` ;
2527
2628export default AnimatedDiv ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { RouteComponentProps } from 'react-router-dom' ;
3+ import FadeInEntrance from '../../components/fadeInEntrance' ;
34
45type Props = { } & RouteComponentProps < any , any > ;
56
67function About ( { } : Props ) {
78 return (
8- < div >
9+ < FadeInEntrance >
910 < h1 > About</ h1 >
10- </ div >
11+ </ FadeInEntrance >
1112 ) ;
1213}
1314
Original file line number Diff line number Diff line change 11import { compose } from 'redux' ;
22import About from './About' ;
3- import withEnterAnimation from '../../hoc/withEnterAnimation' ;
43
5- export default compose ( withEnterAnimation ( /* no option yet */ ) ) ( About ) ;
4+ export default compose ( ) ( About ) ;
Original file line number Diff line number Diff line change @@ -5,12 +5,13 @@ import { Link } from 'react-router-dom';
55import HomeInfo from './styled/HomeInfo' ;
66import MainTitle from './styled/MainTitle' ;
77import LightNote from './styled/LightNote' ;
8+ import FadeInEntrance from '../../components/fadeInEntrance' ;
89
910type Props = { } & RouteComponentProps < any , any > ;
1011
1112function Home ( { } : Props ) {
1213 return (
13- < div >
14+ < FadeInEntrance >
1415 < Jumbotron >
1516 < HomeInfo >
1617 < MainTitle > ReactJS 16.4+ Bootstrap 4</ MainTitle >
@@ -38,7 +39,7 @@ function Home({}: Props) {
3839 </ p >
3940 </ HomeInfo >
4041 </ Jumbotron >
41- </ div >
42+ </ FadeInEntrance >
4243 ) ;
4344}
4445
Original file line number Diff line number Diff line change 11import { compose } from 'redux' ;
22import Home from './Home' ;
3- import withEnterAnimation from '../../hoc/withEnterAnimation' ;
43
5- export default compose ( withEnterAnimation ( /* no option yet */ ) ) ( Home ) ;
4+ export default compose ( ) ( Home ) ;
You can’t perform that action at this time.
0 commit comments