Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import React, { createContext, useContext } from "react" import type { PlatformConfig } from "../config/platform.config" import { PLATFORM_CONFIG } from "../config/platform.config" const PlatformContext = createContext<PlatformConfig>(PLATFORM_CONFIG) export const PlatformProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => { return <PlatformContext.Provider value={PLATFORM_CONFIG}>{children}</PlatformContext.Provider> } export const usePlatform = () => { return useContext(PlatformContext) } // Optional convenience hooks for individual config values export const useShowNavbar = () => usePlatform().showNavbar |