refactor: clean code
This commit is contained in:
@@ -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: [] } },
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user