알림함 카테고리 셋팅

This commit is contained in:
focp212@naver.com
2025-10-27 11:30:02 +09:00
parent 9eba765957
commit 9be67b403e
12 changed files with 242 additions and 130 deletions

View File

@@ -1,45 +1,56 @@
import { AlarmList } from '@/entities/alarm/ui/alarm-list';
import { HeaderType } from '@/entities/common/model/types';
import { useStore } from '@/shared/model/store';
import {
useSetHeaderTitle,
useSetHeaderType,
useSetFooterMode
} from '@/widgets/sub-layout/use-sub-layout';
import { useState } from 'react';
import { useEffect, useState } from 'react';
export const ListPage = () => {
let totalAppNotificationCategories = useStore.getState().CommonStore.appNotificationCategories;
const [appNotificationCategories, setAppNotificationCategories] = useState<Array<any>>(totalAppNotificationCategories);
useSetHeaderTitle('알림함');
useSetHeaderType(HeaderType.LeftArrow);
useSetFooterMode(false);
const [category, setCategory] = useState<string>('all');
const [appNotificationCategory, setAppNotificationCategory] = useState<string>('');
let btnList = [
{name: '전체', category: 'all'},
{name: '혜택/이벤트', category: 'event'},
{name: '공지사항', category: 'notice'}
];
const onClickToCategory = (value: any) => {
setCategory(value.category);
const resetAlarmCategories = () => {
if(appNotificationCategories){
let newAppNotificationCategories = appNotificationCategories.filter((value, index) => {
return value.code1 !== '****' && value.code2 === '*';
});
setAppNotificationCategories(newAppNotificationCategories);
}
};
useEffect(() => {
resetAlarmCategories();
}, [totalAppNotificationCategories])
return (
<>
<main className="pop">
<div className="sub-wrap">
<div className="notice-tabs">
{
btnList.map((value, index) => (
<button
className={ `tab36 ${(appNotificationCategory === '')? 'on': ''}`}
onClick={ () => setAppNotificationCategory('') }
></button>
{ !!appNotificationCategories &&
appNotificationCategories.map((value, index) => (
<button
className={ `tab36 ${(category === value.category)? 'on': ''}`}
onClick={ () => onClickToCategory(value) }
>{ value.name }</button>
className={ `tab36 ${(appNotificationCategory === value.code1)? 'on': ''}`}
onClick={ () => setAppNotificationCategory(value.code1) }
>{ value.desc1 }</button>
))
}
</div>
<AlarmList
category={ category }
appNotificationCategory={ appNotificationCategory }
></AlarmList>
</div>
</main>

View File

@@ -50,6 +50,10 @@ export const AllTransactionCancelPage = () => {
const [vatAutoCalcSummary, setVatAutoCalcSummary] = useState<number>(0);
const [totalCancelAmount, setTotalCancelAmount] = useState<number>(0);
const [cancelPassword, setCancelPassword] = useState<string>('');
const [cancelSupplyAmount, setCancelSupplyAmount] = useState<number>(0);
const [cancelGoodsVat, setCancelGoodsVat] = useState<number>(0);
const [cancelTaxFreeAmount, setCancelTaxFreeAmount] = useState<number>(0);
const [cancelServiceAmount, setCancelServiceAmount] = useState<number>(0);
const [bankCode, setBankCode] = useState<string>('');
const [accountNo, setAccountNo] = useState<string>('');
@@ -105,10 +109,10 @@ export const AllTransactionCancelPage = () => {
bankCode: bankCode,
accountNo: accountNo,
accountHolder: accountHolder,
supplyAmount: supplyAmount,
goodsVatAmount: goodsVat,
taxFreeAmount: taxFreeAmount,
serviceAmount: serviceAmount,
supplyAmount: (!!partCancelCl)? cancelSupplyAmount: supplyAmount,
goodsVatAmount: (!!partCancelCl)? cancelGoodsVat: goodsVat,
taxFreeAmount: (!!partCancelCl)? cancelTaxFreeAmount: taxFreeAmount,
serviceAmount: (!!partCancelCl)? cancelServiceAmount: serviceAmount,
clientIp: userInfo.clientAddressIP,
partCancelCl: partCancelCl,
isNpg: isNpg,
@@ -195,7 +199,7 @@ export const AllTransactionCancelPage = () => {
setAccountHolder={ setAccountHolder }
></AllTransactionAllCancel>
}
{ partCancelCl && (tabAction === CancelTabKeys.Part) &&
{ !!partCancelCl && (tabAction === CancelTabKeys.Part) &&
<AllTransactionPartCancel
serviceCode={ serviceCode }
debtPreventionCancelDisplayInfo={ debtPreventionCancelDisplayInfo }
@@ -220,6 +224,14 @@ export const AllTransactionCancelPage = () => {
setAccountNo={ setAccountNo }
accountHolder={ accountHolder }
setAccountHolder={ setAccountHolder }
cancelSupplyAmount={ cancelSupplyAmount }
setCancelSupplyAmount={ setCancelSupplyAmount }
cancelGoodsVat={ cancelGoodsVat }
setCancelGoodsVat={ setCancelGoodsVat }
cancelTaxFreeAmount={ cancelTaxFreeAmount}
setCancelTaxFreeAmount={ setCancelTaxFreeAmount }
cancelServiceAmount={ cancelServiceAmount }
setCancelServiceAmount={ setCancelServiceAmount }
></AllTransactionPartCancel>
}
</div>