import { useEffect, useRef } from 'react' import styles from '@/components/header.module.css' import { Container, Nav, Navbar } from 'react-bootstrap' import { NavPrice, MeCorner, AnonCorner, SearchItem, Back, NavWalletSummary, Brand, SignUpButton } from './common' import { useMe } from '@/components/me' import classNames from 'classnames' export default function StickyBar ({ prefix, sub, path, topNavKey, dropNavKey }) { const ref = useRef() const sticky = useRef() const me = useMe() useEffect(() => { const observer = new window.IntersectionObserver(([entry]) => { sticky?.current?.classList.toggle(styles.hide, entry.isIntersecting) }) ref?.current && observer.observe(ref.current) return () => { ref?.current && observer.unobserve(ref.current) } }, [ref?.current, sticky?.current]) return ( <>
) }