알림함 카테고리 셋팅
This commit is contained in:
@@ -16,6 +16,8 @@ export interface CommonState {
|
||||
setBankList: (update: SetStateAction<Array<any>>) => void;
|
||||
virtualBankList: Array<any>;
|
||||
setVirtualBankList: (update: SetStateAction<Array<any>>) => void;
|
||||
appNotificationCategories: Array<any>;
|
||||
setAppNotificationCategories: (update: SetStateAction<Array<any>>) => void;
|
||||
};
|
||||
|
||||
const initialBannerInfoState = {
|
||||
@@ -24,6 +26,10 @@ const initialBannerInfoState = {
|
||||
|
||||
const initialCommonState = {
|
||||
serviceCodes: [] as Array<any>,
|
||||
creditCardList: [] as Array<any>,
|
||||
bankList: [] as Array<any>,
|
||||
virtualBankList: [] as Array<any>,
|
||||
appNotificationCategories: [] as Array<any>
|
||||
} as CommonState;
|
||||
|
||||
export const createBannerInfoStore = lens<BannerInfoState>((set, get) => ({
|
||||
@@ -94,4 +100,16 @@ export const createCommonStore = lens<CommonState>((set, get) => ({
|
||||
};
|
||||
});
|
||||
},
|
||||
setAppNotificationCategories: (update) => {
|
||||
set((state: CommonState) => {
|
||||
const newAppNotificationCategories = (typeof update === 'function')
|
||||
? update(state.appNotificationCategories): update;
|
||||
return {
|
||||
...state,
|
||||
appNotificationCategories: [
|
||||
...newAppNotificationCategories
|
||||
]
|
||||
};
|
||||
});
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user