// @flow // @jsx glam import glam from 'glam' import React, { Component, type Node } from 'react' import { Link, withRouter } from 'react-router-dom' import { colors } from '../theme' import { smallDevice, largeDevice } from '../utils' const navWidth = 180 const appWidth = 840 const appGutter = 15 const contentGutter = 20 const pagePadding = 120 export const AppContainer = (props: any) => (
) export const PageContent = (props: any) => ( ) export const AppContent = (props: any) => ( ) export const Nav = ({ children }: { children: Node }) => ( ) type ItemProps = { children: Node, icon: string, isSelected: boolean, to: string, } export const NavItem = ({ children, icon, isSelected, to }: ItemProps) => { const attrs = isSelected ? { 'aria-current': 'page' } : {} return ( {icon} {children} ) } const Footer = () => { const size = window.innerWidth > 769 ? 'large' : null return ( ) } // Return scroll to top on route change class ScrollToTop extends Component<*> { componentDidUpdate(prevProps) { const { history, location } = this.props // do not influence scroll on browser back/forward if (history.action === 'POP') return // no scroll when extending the current path const pathArr = location.pathname.split('/') if (!prevProps.location.pathname.includes(pathArr[1])) { window.scrollTo(0, 0) } } render() { return this.props.children } } export const ScrollRestoration = withRouter(ScrollToTop)