Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
nakasyou authored Aug 27, 2023
1 parent 324a004 commit be08837
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/app/note/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ import type { Editor } from "@tiptap/react"
export interface Props {

}
export const ModeContext = createContext<"edit" | "play">('edit')
export const UserStateContext = createContext<{
mode: "edit" | "play",
isView: boolean
}>({
mode: 'edit',
isView: true,
})


export default function(props: Props){
const [mode, setMode] = useState<"edit" | "play">("edit")
Expand Down Expand Up @@ -63,7 +70,10 @@ export default function(props: Props){
</div>
<div className="bg-background text-on-background min-h-screen">
<div>
<ModeContext.Provider value={mode}>
<ModeContext.Provider value={{
mode,
isView,
}}>
{ noteElements }
</ModeContext.Provider>
</div>
Expand Down

0 comments on commit be08837

Please sign in to comment.