Skip to content

Commit

Permalink
some comments never hurt
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur committed Jul 8, 2024
1 parent 5c0decc commit c948d8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui2/src/components/DualPanel/DualPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function DualPanel() {
}

return (
<PanelContext.Provider value="main">
<PanelContext.Provider value={"main"}>
<SinglePanel />
</PanelContext.Provider>
)
Expand Down
11 changes: 11 additions & 0 deletions ui2/src/contexts/PanelContext.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import {createContext} from "react"
import type {PanelMode} from "@/types"

/*
`@/component/DualPanel` component features two panels. One of the panels
is called "main" and another one "secondary". Both panels
are rendered using same `@/components/SinglePanel` component. In
order to distinguish between the two - panel mode is passed as via
react context.
Panel with mode "main" (i.e. main panel) is always present.
Panel with mode "secondary" - may or may not be present; in other
words, "secondary" panel may be closed, while "main" panel
cannot be closed.
*/
const PanelContext = createContext<PanelMode>("main")

export default PanelContext

0 comments on commit c948d8b

Please sign in to comment.