
This removes the useApp hook from all org pages in favor of various context. This means there is no longer global state that gets passed around, instead each component that requires access to something shared (like account, or navigation) can just use the context instead. This is a first step, as a lot of shared components stil rely on app not to mention the dev and lab sites.
14 lines
328 B
JavaScript
14 lines
328 B
JavaScript
import { useEffect, useContext } from 'react'
|
|
import { NavigationContext } from 'shared/context/navigation-context.mjs'
|
|
|
|
export const useNavigation = ({ page }) => {
|
|
const all = useContext(NavigationContext)
|
|
|
|
useEffect(() => {}, [page.path, page.t])
|
|
|
|
return {
|
|
title: page.t,
|
|
slug: page.s,
|
|
order: page.o,
|
|
}
|
|
}
|