Files
cline-multi-mirror/webview-ui/src/context/PlatformContext.tsx
T
Sarah Fortune 0cefe107b8 Add a configuration for the toggle plan/act mode keyboard shortcut. (#6125)
JetBrains already uses cmd-shift-p, so cmd-shift-a instead. Add a new field to
the platform specific config for the keyboard shortcut.

ref FDN-3
2025-09-11 09:50:31 -07:00

17 lines
639 B
TypeScript

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