mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 10:50:38 +09:00
fix(inbox): address Greptile review findings
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
50e9f69010
commit
833842b391
8 changed files with 49 additions and 29 deletions
28
ui/src/context/GeneralSettingsContext.tsx
Normal file
28
ui/src/context/GeneralSettingsContext.tsx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import type { ReactNode } from "react";
|
||||
import { createContext, useContext } from "react";
|
||||
|
||||
export interface GeneralSettingsContextValue {
|
||||
keyboardShortcutsEnabled: boolean;
|
||||
}
|
||||
|
||||
const GeneralSettingsContext = createContext<GeneralSettingsContextValue>({
|
||||
keyboardShortcutsEnabled: false,
|
||||
});
|
||||
|
||||
export function GeneralSettingsProvider({
|
||||
value,
|
||||
children,
|
||||
}: {
|
||||
value: GeneralSettingsContextValue;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<GeneralSettingsContext.Provider value={value}>
|
||||
{children}
|
||||
</GeneralSettingsContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useGeneralSettings() {
|
||||
return useContext(GeneralSettingsContext);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue