forked from Shiloh/remnantchat
dfe510e642
* feat: add Username component * feat: set custom username state * feat: update custom username on input blur * feat: inform peers of username updates * feat: display username for peers * feat: show static name in parentheses * feat: use display name in message notification * feat: remove username display from Shell Drawer * feat: persist customUsername
20 lines
530 B
TypeScript
20 lines
530 B
TypeScript
import { createContext } from 'react'
|
|
|
|
import { UserSettings } from 'models/settings'
|
|
|
|
export interface SettingsContextProps {
|
|
updateUserSettings: (settings: Partial<UserSettings>) => Promise<void>
|
|
getUserSettings: () => UserSettings
|
|
}
|
|
|
|
export const SettingsContext = createContext<SettingsContextProps>({
|
|
updateUserSettings: () => Promise.resolve(),
|
|
getUserSettings: () => ({
|
|
userId: '',
|
|
customUsername: '',
|
|
colorMode: 'dark',
|
|
playSoundOnNewMessage: true,
|
|
showNotificationOnNewMessage: true,
|
|
}),
|
|
})
|