import React, { useState } from 'react' import { Flex, Box } from 'theme-ui' import { useScrollSwipe } from '../hooks/use-scroll-swipe' import { Transition } from 'react-transition-group' /** * 导航栏的高度 * @example * ```jsx * * ``` */ export const NAV_HEIGHT = '4rem' export const Navbar: React.FunctionComponent = (props) => { const [visible, setVisible] = useState(true) useScrollSwipe((direction) => { if (direction === 'down') { setVisible(false) } else if (direction === 'up') { setVisible(true) } }) return ( {(state) => { const onEnter = state === 'entering' || state === 'entered' return ( {props.children} ) }} ) } export const NavbarItem: React.FunctionComponent = (props) => { return ( {props.children} ) }