feat: support hiding indirect notifications
This commit is contained in:
parent
331811f683
commit
2cd1ae481b
27 changed files with 196 additions and 38 deletions
14
src/providers/NotificationUserPreferenceProvider.tsx
Normal file
14
src/providers/NotificationUserPreferenceProvider.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { createContext, useContext } from 'react'
|
||||
|
||||
type TNotificationUserPreferenceContext = {
|
||||
hideIndirect: boolean
|
||||
updateHideIndirect: (enable: boolean) => void
|
||||
}
|
||||
|
||||
export const NotificationUserPreferenceContext =
|
||||
createContext<TNotificationUserPreferenceContext | null>(null)
|
||||
|
||||
export function useNotificationUserPreference() {
|
||||
const ctx = useContext(NotificationUserPreferenceContext)
|
||||
return ctx ?? { hideIndirect: false, updateHideIndirect: () => {} }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue