aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/animations/slide_animations.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-31 06:32:43 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-31 06:32:43 +0800
commit4456c3ee14f5cd778e0d16ab42a3e2e34d102f23 (patch)
tree59b4d1e63c31477b96adb13fd55d44baf094208b /packages/instant/src/components/animations/slide_animations.tsx
parenta49bf353f85c22a029db3085a620f3c031b52d73 (diff)
downloaddexon-0x-contracts-4456c3ee14f5cd778e0d16ab42a3e2e34d102f23.tar.gz
dexon-0x-contracts-4456c3ee14f5cd778e0d16ab42a3e2e34d102f23.tar.zst
dexon-0x-contracts-4456c3ee14f5cd778e0d16ab42a3e2e34d102f23.zip
feat: allow for flexible position in position animation component
Diffstat (limited to 'packages/instant/src/components/animations/slide_animations.tsx')
-rw-r--r--packages/instant/src/components/animations/slide_animations.tsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/instant/src/components/animations/slide_animations.tsx b/packages/instant/src/components/animations/slide_animations.tsx
index 99533a2f0..9f1535297 100644
--- a/packages/instant/src/components/animations/slide_animations.tsx
+++ b/packages/instant/src/components/animations/slide_animations.tsx
@@ -3,16 +3,21 @@ import { Keyframes } from 'styled-components';
import { css, keyframes, styled } from '../../style/theme';
-import { PositionAnimation, PositionAnimationProps } from './position_animation';
+import { PositionAnimation, PositionAnimationSettings } from './position_animation';
export type SlideAnimationPhase = 'slideIn' | 'slideOut';
export interface SlideAnimationProps {
+ position: string;
phase: SlideAnimationPhase;
- slideIn: PositionAnimationProps;
- slideOut: PositionAnimationProps;
+ slideIn: PositionAnimationSettings;
+ slideOut: PositionAnimationSettings;
}
export const SlideAnimation: React.StatelessComponent<SlideAnimationProps> = props => {
const propsToUse = props.phase === 'slideIn' ? props.slideIn : props.slideOut;
- return <PositionAnimation {...propsToUse}>{props.children}</PositionAnimation>;
+ return (
+ <PositionAnimation position={props.position} {...propsToUse}>
+ {props.children}
+ </PositionAnimation>
+ );
};