import React, { useEffect } from 'react' import Transition from 'lib/Transition' type Props = { title?: string children?: React.ReactNode className?: string open?: boolean handleCancel?: any singleBgColor?: boolean } const FlyOut = (props: Props) => { const { title = '', children, className = '', singleBgColor = false, handleCancel } = props useEffect(() => { function handleScroll() { if (window.pageYOffset > 96) handleCancel() } window.addEventListener('scroll', handleScroll) return () => window.removeEventListener('scroll', handleScroll) }, []) return ( <> <>