1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-05-19 08:34:47 +07:00

add user notifications ()

* added notification settings

* notifications: added list to profile

* notifications: changed appearance for comment notifications
This commit is contained in:
muerwre 2023-03-11 17:16:31 +06:00 committed by GitHub
parent 23701a5261
commit a39d000ff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 552 additions and 218 deletions
src/utils/providers

View file

@ -0,0 +1,31 @@
import { createContext, FC, useContext } from 'react';
import { observer } from 'mobx-react-lite';
import { useNotificationSettings } from '~/hooks/notifications/useNotificationSettings';
interface NotificationProviderProps {}
const defaultValue = {
available: false,
enabled: false,
hasNew: false,
};
const NotificationContext = createContext(defaultValue);
const NotificationProvider: FC<NotificationProviderProps> = observer(
({ children }) => {
const value = useNotificationSettings();
return (
<NotificationContext.Provider value={value}>
{children}
</NotificationContext.Provider>
);
},
);
export const useNotifications = () => useContext(NotificationContext);
export { NotificationProvider };