diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-01 02:55:48 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-01 02:55:48 +0800 |
commit | 27258fe3d45b8ffae81b74da43e473ae5905edc1 (patch) | |
tree | f4ebc7107ce10b10ac4b75b758b54d66c6ddd887 /packages/instant/src/components/animations | |
parent | 91f8487947d7941b508c34d1bfc1e72c0840c33d (diff) | |
download | dexon-sol-tools-27258fe3d45b8ffae81b74da43e473ae5905edc1.tar dexon-sol-tools-27258fe3d45b8ffae81b74da43e473ae5905edc1.tar.gz dexon-sol-tools-27258fe3d45b8ffae81b74da43e473ae5905edc1.tar.bz2 dexon-sol-tools-27258fe3d45b8ffae81b74da43e473ae5905edc1.tar.lz dexon-sol-tools-27258fe3d45b8ffae81b74da43e473ae5905edc1.tar.xz dexon-sol-tools-27258fe3d45b8ffae81b74da43e473ae5905edc1.tar.zst dexon-sol-tools-27258fe3d45b8ffae81b74da43e473ae5905edc1.zip |
chore: address PR feedback
Diffstat (limited to 'packages/instant/src/components/animations')
-rw-r--r-- | packages/instant/src/components/animations/position_animation.tsx | 14 | ||||
-rw-r--r-- | packages/instant/src/components/animations/slide_animation.tsx | 6 |
2 files changed, 12 insertions, 8 deletions
diff --git a/packages/instant/src/components/animations/position_animation.tsx b/packages/instant/src/components/animations/position_animation.tsx index aefd7ef30..4bb21befb 100644 --- a/packages/instant/src/components/animations/position_animation.tsx +++ b/packages/instant/src/components/animations/position_animation.tsx @@ -2,6 +2,11 @@ import { Keyframes } from 'styled-components'; import { css, keyframes, styled } from '../../style/theme'; +export interface TransitionInfo { + from: string; + to: string; +} + const generateTransitionInfoCss = ( key: keyof TransitionInfo, top?: TransitionInfo, @@ -39,11 +44,6 @@ const slideKeyframeGenerator = ( } `; -export interface TransitionInfo { - from: string; - to: string; -} - export interface PositionAnimationSettings { top?: TransitionInfo; bottom?: TransitionInfo; @@ -74,3 +74,7 @@ export const PositionAnimation = height: 100%; width: 100%; `; + +PositionAnimation.defaultProps = { + position: 'relative', +}; diff --git a/packages/instant/src/components/animations/slide_animation.tsx b/packages/instant/src/components/animations/slide_animation.tsx index 4124e50c3..66a314c7f 100644 --- a/packages/instant/src/components/animations/slide_animation.tsx +++ b/packages/instant/src/components/animations/slide_animation.tsx @@ -6,15 +6,15 @@ export type SlideAnimationState = 'slidIn' | 'slidOut' | 'none'; export interface SlideAnimationProps { position: string; animationState: SlideAnimationState; - slideIn: PositionAnimationSettings; - slideOut: PositionAnimationSettings; + slideInSettings: PositionAnimationSettings; + slideOutSettings: PositionAnimationSettings; } export const SlideAnimation: React.StatelessComponent<SlideAnimationProps> = props => { if (props.animationState === 'none') { return <React.Fragment>{props.children}</React.Fragment>; } - const propsToUse = props.animationState === 'slidIn' ? props.slideIn : props.slideOut; + const propsToUse = props.animationState === 'slidIn' ? props.slideInSettings : props.slideOutSettings; return ( <PositionAnimation position={props.position} {...propsToUse}> {props.children} |