Skip to content

Commit bf20cf8

Browse files
committed
fix different carousels named the exact same thing
1 parent 52098a3 commit bf20cf8

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

components/nav/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useRouter } from 'next/router'
22
import DesktopHeader from './desktop/header'
33
import MobileHeader from './mobile/header'
44
import StickyBar from './sticky-bar'
5-
import { CarouselProvider } from './carousel'
5+
import { PriceCarouselProvider } from './price-carousel'
66

77
export default function Navigation ({ sub }) {
88
const router = useRouter()
@@ -17,10 +17,10 @@ export default function Navigation ({ sub }) {
1717
}
1818

1919
return (
20-
<CarouselProvider>
20+
<PriceCarouselProvider>
2121
<DesktopHeader {...props} />
2222
<MobileHeader {...props} />
2323
<StickyBar {...props} />
24-
</CarouselProvider>
24+
</PriceCarouselProvider>
2525
)
2626
}

components/nav/carousel.js renamed to components/nav/price-carousel.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const carousel = [
1212
'halving'
1313
]
1414

15-
export const CarouselContext = createContext({
15+
export const PriceCarouselContext = createContext({
1616
selection: undefined,
1717
handleClick: () => {}
1818
})
1919

20-
export function CarouselProvider ({ children }) {
20+
export function PriceCarouselProvider ({ children }) {
2121
const [selection, setSelection] = useState(undefined)
2222
const [pos, setPos] = useState(0)
2323

@@ -35,12 +35,12 @@ export function CarouselProvider ({ children }) {
3535
}, [pos])
3636

3737
return (
38-
<CarouselContext.Provider value={[selection, handleClick]}>
38+
<PriceCarouselContext.Provider value={[selection, handleClick]}>
3939
{children}
40-
</CarouselContext.Provider>
40+
</PriceCarouselContext.Provider>
4141
)
4242
}
4343

44-
export function useCarousel () {
45-
return useContext(CarouselContext)
44+
export function usePriceCarousel () {
45+
return useContext(PriceCarouselContext)
4646
}

components/nav/static.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Container, Nav, Navbar } from 'react-bootstrap'
22
import styles from '../header.module.css'
33
import { BackOrBrand, NavPrice, SearchItem } from './common'
4-
import { CarouselProvider } from './carousel'
4+
import { PriceCarouselProvider } from './price-carousel'
55

66
export default function StaticHeader () {
77
return (
8-
<CarouselProvider>
8+
<PriceCarouselProvider>
99
<Container as='header' className='px-sm-0'>
1010
<Navbar>
1111
<Nav
@@ -17,6 +17,6 @@ export default function StaticHeader () {
1717
</Nav>
1818
</Navbar>
1919
</Container>
20-
</CarouselProvider>
20+
</PriceCarouselProvider>
2121
)
2222
}

components/price.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { NORMAL_POLL_INTERVAL, SSR } from '@/lib/constants'
88
import { useBlockHeight } from './block-height'
99
import { useChainFee } from './chain-fee'
1010
import { CompactLongCountdown } from './countdown'
11-
import { useCarousel } from './nav/carousel'
11+
import { usePriceCarousel } from './nav/price-carousel'
1212

1313
export const PriceContext = React.createContext({
1414
price: null,
@@ -45,7 +45,7 @@ export function PriceProvider ({ price, children }) {
4545
}
4646

4747
export default function Price ({ className }) {
48-
const [selection, handleClick] = useCarousel()
48+
const [selection, handleClick] = usePriceCarousel()
4949

5050
const { price, fiatSymbol } = usePrice()
5151
const { height: blockHeight, halving } = useBlockHeight()

0 commit comments

Comments
 (0)