- replace template home page with Compass branding and WIP notice - rewrite dashboard as project status page with working/in-progress/planned sections - fix content scrolling inside inset panel (no more clipped rounded corners) - extract command menu into shared context so sidebar search triggers it too
33 lines
680 B
TypeScript
Executable File
33 lines
680 B
TypeScript
Executable File
"use client"
|
|
|
|
import * as React from "react"
|
|
import { CommandMenu } from "@/components/command-menu"
|
|
|
|
const CommandMenuContext = React.createContext<{
|
|
open: () => void
|
|
}>({ open: () => {} })
|
|
|
|
export function useCommandMenu() {
|
|
return React.useContext(CommandMenuContext)
|
|
}
|
|
|
|
export function CommandMenuProvider({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode
|
|
}) {
|
|
const [isOpen, setIsOpen] = React.useState(false)
|
|
|
|
const value = React.useMemo(
|
|
() => ({ open: () => setIsOpen(true) }),
|
|
[]
|
|
)
|
|
|
|
return (
|
|
<CommandMenuContext.Provider value={value}>
|
|
{children}
|
|
<CommandMenu open={isOpen} setOpen={setIsOpen} />
|
|
</CommandMenuContext.Provider>
|
|
)
|
|
}
|