refactor: clean code

This commit is contained in:
Fu Diwei
2024-10-22 11:38:55 +08:00
parent 18a7bf0d66
commit 716f5f1426
26 changed files with 63 additions and 60 deletions

View File

@@ -26,13 +26,13 @@ export type ConfigContext = {
const Context = createContext({} as ConfigContext);
export const useConfig = () => useContext(Context);
export const useConfigContext = () => useContext(Context);
interface ContainerProps {
interface ConfigProviderProps {
children: ReactNode;
}
export const ConfigProvider = ({ children }: ContainerProps) => {
export const ConfigProvider = ({ children }: ConfigProviderProps) => {
const [config, dispatchConfig] = useReducer(configReducer, {
accesses: [],
emails: { content: { emails: [] } },

View File

@@ -12,12 +12,13 @@ export type NotifyContext = {
const Context = createContext({} as NotifyContext);
export const useNotify = () => useContext(Context);
interface ContainerProps {
export const useNotifyContext = () => useContext(Context);
interface NotifyProviderProps {
children: ReactNode;
}
export const NotifyProvider = ({ children }: ContainerProps) => {
export const NotifyProvider = ({ children }: NotifyProviderProps) => {
const [notify, dispatchNotify] = useReducer(notifyReducer, {});
useEffect(() => {