compassmock/src/components/settings-provider.tsx
Nicholai 21edd5469c
feat(ui): redesign landing page and polish dashboard (#86)
Dark cartographic landing page with compass rose animation,
feature cards, modules ticker, and gantt showcase section.
Unified contacts page, settings page routing, sidebar
updates, and VisibilityState type fix in people table.

Co-authored-by: Nicholai <nicholaivogelfilms@gmail.com>
2026-02-15 18:07:13 -07:00

37 lines
780 B
TypeScript
Executable File

"use client"
import * as React from "react"
import { useRouter } from "next/navigation"
const SettingsContext = React.createContext<{
open: () => void
}>({ open: () => {} })
export function useSettings() {
return React.useContext(SettingsContext)
}
/**
* Settings is now a full page at /dashboard/settings.
* This provider keeps the useSettings().open() API working
* for any callers that still use it (command palette, etc).
*/
export function SettingsProvider({
children,
}: {
children: React.ReactNode
}) {
const router = useRouter()
const value = React.useMemo(
() => ({ open: () => router.push("/dashboard/settings") }),
[router]
)
return (
<SettingsContext.Provider value={value}>
{children}
</SettingsContext.Provider>
)
}