-
-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update blockquote style for note
Signed-off-by: Innei <tukon479@gmail.com>
- Loading branch information
Showing
6 changed files
with
100 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,36 @@ | ||
'use client' | ||
|
||
import { createContextState } from 'foxact/context-state' | ||
import { createContext, useContext, useState } from 'react' | ||
import type { Dispatch, FC, PropsWithChildren, SetStateAction } from 'react' | ||
|
||
export const [CurrentNoteIdProvider, useCurrentNoteId, useSetCurrentNoteId] = | ||
createContextState<undefined | string>(undefined) | ||
// export const [CurrentNoteIdProvider, useCurrentNoteId, useSetCurrentNoteId] = | ||
// createContextState<undefined | string>(undefined) | ||
|
||
const CurrentNoteIdContext = createContext(undefined as undefined | string) | ||
|
||
const SetCurrentNoteIdContext = createContext< | ||
Dispatch<SetStateAction<string | undefined>> | ||
>(() => void 0) | ||
|
||
const CurrentNoteIdProvider: FC< | ||
{ | ||
initialNoteId?: string | ||
} & PropsWithChildren | ||
> = ({ initialNoteId, children }) => { | ||
const [currentNoteId, setCurrentNoteId] = useState(initialNoteId) | ||
return ( | ||
<CurrentNoteIdContext.Provider value={currentNoteId}> | ||
<SetCurrentNoteIdContext.Provider value={setCurrentNoteId}> | ||
{children} | ||
</SetCurrentNoteIdContext.Provider> | ||
</CurrentNoteIdContext.Provider> | ||
) | ||
} | ||
const useCurrentNoteId = () => { | ||
return useContext(CurrentNoteIdContext) | ||
} | ||
const useSetCurrentNoteId = () => { | ||
return useContext(SetCurrentNoteIdContext) | ||
} | ||
|
||
export { useCurrentNoteId, useSetCurrentNoteId, CurrentNoteIdProvider } |