diff --git a/components/nav/index.js b/components/nav/index.js index f8906b27..beacbd6f 100644 --- a/components/nav/index.js +++ b/components/nav/index.js @@ -2,7 +2,7 @@ import { useRouter } from 'next/router' import DesktopHeader from './desktop/header' import MobileHeader from './mobile/header' import StickyBar from './sticky-bar' -import { CarouselProvider } from './carousel' +import { PriceCarouselProvider } from './price-carousel' export default function Navigation ({ sub }) { const router = useRouter() @@ -17,10 +17,10 @@ export default function Navigation ({ sub }) { } return ( - + - + ) } diff --git a/components/nav/carousel.js b/components/nav/price-carousel.js similarity index 74% rename from components/nav/carousel.js rename to components/nav/price-carousel.js index 293e9c28..0b09c672 100644 --- a/components/nav/carousel.js +++ b/components/nav/price-carousel.js @@ -12,12 +12,12 @@ const carousel = [ 'halving' ] -export const CarouselContext = createContext({ +export const PriceCarouselContext = createContext({ selection: undefined, handleClick: () => {} }) -export function CarouselProvider ({ children }) { +export function PriceCarouselProvider ({ children }) { const [selection, setSelection] = useState(undefined) const [pos, setPos] = useState(0) @@ -35,12 +35,12 @@ export function CarouselProvider ({ children }) { }, [pos]) return ( - + {children} - + ) } -export function useCarousel () { - return useContext(CarouselContext) +export function usePriceCarousel () { + return useContext(PriceCarouselContext) } diff --git a/components/nav/static.js b/components/nav/static.js index 68400f1e..707fccc6 100644 --- a/components/nav/static.js +++ b/components/nav/static.js @@ -1,11 +1,11 @@ import { Container, Nav, Navbar } from 'react-bootstrap' import styles from '../header.module.css' import { BackOrBrand, NavPrice, SearchItem } from './common' -import { CarouselProvider } from './carousel' +import { PriceCarouselProvider } from './price-carousel' export default function StaticHeader () { return ( - +