chore: server-and-serverless template
This commit is contained in:
19
apps/app/src/contexts/preferences.tsx
Normal file
19
apps/app/src/contexts/preferences.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { createContext, useContext } from 'react'
|
||||
|
||||
export interface PreferencesContextValue {
|
||||
locale: string
|
||||
themeId: string
|
||||
setLocale: (locale: string) => void
|
||||
setThemeId: (themeId: string) => void
|
||||
}
|
||||
|
||||
export const PreferencesContext = createContext<PreferencesContextValue>({
|
||||
locale: 'en',
|
||||
themeId: 'default',
|
||||
setLocale: () => {},
|
||||
setThemeId: () => {},
|
||||
})
|
||||
|
||||
export function usePreferences(): PreferencesContextValue {
|
||||
return useContext(PreferencesContext)
|
||||
}
|
||||
Reference in New Issue
Block a user