import * as React from 'react'; import { ScreenSpecification } from '../style/media'; import { ColorOption } from '../style/theme'; import { zIndex } from '../style/z_index'; import { SlideAnimationState } from '../types'; import { PositionAnimationSettings } from './animations/position_animation'; import { SlideAnimation } from './animations/slide_animation'; import { Container } from './ui/container'; import { Flex } from './ui/flex'; import { Text } from './ui/text'; export interface ErrorProps { icon: string; message: string; } export const Error: React.StatelessComponent = props => ( {props.icon} {props.message} ); Error.displayName = 'Error'; export interface SlidingErrorProps extends ErrorProps { animationState: SlideAnimationState; } export const SlidingError: React.StatelessComponent = props => { const slideAmount = '120px'; const desktopSlideIn: PositionAnimationSettings = { timingFunction: 'ease-in', top: { from: slideAmount, to: '0px', }, position: 'relative', }; const desktopSlideOut: PositionAnimationSettings = { timingFunction: 'cubic-bezier(0.25, 0.1, 0.25, 1)', top: { from: '0px', to: slideAmount, }, position: 'relative', }; const mobileSlideIn: PositionAnimationSettings = { duration: '0.5s', timingFunction: 'ease-in', top: { from: '-120px', to: '0px' }, position: 'fixed', }; const moblieSlideOut: PositionAnimationSettings = { duration: '0.5s', timingFunction: 'ease-in', top: { from: '0px', to: '-120px' }, position: 'fixed', }; const slideUpSettings: ScreenSpecification = { default: desktopSlideIn, sm: mobileSlideIn, }; const slideOutSettings: ScreenSpecification = { default: desktopSlideOut, sm: moblieSlideOut, }; return ( ); }; SlidingError.displayName = 'SlidingError';