/**@jsx jsx */ import { jsx, SxStyleProp } from 'theme-ui'; import { NavLayerProps } from '.'; import { headerScales } from './utils'; import { qt } from '../../query'; const stylesLayer: SxStyleProp = { position: 'fixed', top: headerScales, left: 0, zIndex: 1, display: 'flex', flexDirection: 'column', justifyContent: 'space-around', boxSizing: 'border-box', width: '100vw', height: `calc(100vh - ${headerScales[0]})`, padding: `${qt('spaces')(9)}px ${qt('spaces')(4)}px ${qt('spaces')(5)}px`, backgroundColor: qt('corals')(1), }; const stylesLayerList: SxStyleProp = { padding: 0, margin: `0 0 ${qt('spaces')(5)}px 0`, }; const stylesLayerFooter: SxStyleProp = { color: qt('whites')(0), fontSize: `${qt('fontSizes')(0)}px`, }; const createStylesExpanded = (isExpanded: boolean): SxStyleProp => ({ ...(isExpanded ? { transform: 'none', transition: `transform ${qt('timing')(3)} ${qt('duration')(1)}s`, } : { transform: 'translate3d(-100%, 0, 0)', transition: `transform ${qt('timing')(4)} ${qt('duration')(1)}s`, }), }); const createStylesLayer = (isExpanded: boolean): SxStyleProp => ({ ...stylesLayer, ...createStylesExpanded(isExpanded), }); export const LayerList: React.FC = (props): JSX.Element => (