import * as React from 'react'; import { Keyframes } from 'styled-components'; import { css, keyframes, styled } from '../../style/theme'; const slideKeyframeGenerator = (fromY: string, toY: string) => keyframes` from { position: relative; top: ${fromY}; } to { position: relative; top: ${toY}; } `; export interface SlideAnimationProps { keyframes: Keyframes; animationType: string; animationDirection?: string; } export const SlideAnimation = styled.div < SlideAnimationProps > ` animation-name: ${props => css` ${props.keyframes}; `}; animation-duration: 0.3s; animation-timing-function: ${props => props.animationType}; animation-delay: 0s; animation-iteration-count: 1; animation-fill-mode: ${props => props.animationDirection || 'none'}; position: relative; `; export interface SlideAnimationComponentProps { downY: string; } export const SlideUpAnimation: React.StatelessComponent = props => ( {props.children} ); export const SlideDownAnimation: React.StatelessComponent = props => ( {props.children} );