알림함 카테고리 셋팅

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

@@ -11,11 +11,11 @@ import { useStore } from '@/shared/model/store';
import { DefaultRequestPagination } from '@/entities/common/model/types';
export interface AlarmListProps {
category: string;
appNotificationCategory: string;
};
export const AlarmList = ({
category
appNotificationCategory
}: AlarmListProps) => {
const { navigate } = useNavigate();
const { t } = useTranslation();
@@ -24,28 +24,10 @@ export const AlarmList = ({
const [onActionIntersect, setOnActionIntersect] = useState<boolean>(false);
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
const [appCl, setAppCl] = useState<MERCHANT_ADMIN_APP>(MERCHANT_ADMIN_APP.MERCHANT_ADMIN_APP)
const [appNotificationCategory, setAppNotificationCategory] = useState<string>('');
const [resultList, setResultList] = useState<Array<AlarmListContent>>([]);
const [selectedCategory, setSelectedCategory] = useState<string>('');
const { mutateAsync: appAlarmList } = useAppAlarmListMutation();
const getAlarmItems = () => {
let rs = [];
for(let i=0;i<resultList.length;i++){
rs.push(
<AlarmItem
appNotificationCategory={ resultList[i]?.appNotificationCategory }
notificationReceivedDate={ resultList[i]?.notificationReceivedDate }
appNotificationTitle={ resultList[i]?.appNotificationTitle }
appNotificationContent={ resultList[i]?.appNotificationContent }
appNotificationLink={ resultList[i]?.appNotificationLink }
></AlarmItem>
)
}
return rs;
};
const onIntersect: IntersectionObserverCallback = (entries: Array<IntersectionObserverEntry>) => {
entries.forEach((entry: IntersectionObserverEntry) => {
if(entry.isIntersecting){
@@ -73,7 +55,7 @@ export const AlarmList = ({
appCl: appCl,
appNotificationCategory: appNotificationCategory,
page: pageParam
}
};
if(type !== 'page' && params.page){
params.page.cursor = null;
@@ -115,11 +97,27 @@ export const AlarmList = ({
}
};
const getAlarmItems = () => {
let rs = [];
for(let i=0;i<resultList.length;i++){
rs.push(
<AlarmItem
appNotificationSequence={ resultList[i]?.appNotificationSequence }
appNotificationCategory={ resultList[i]?.appNotificationCategory }
notificationReceivedDate={ resultList[i]?.notificationReceivedDate }
appNotificationTitle={ resultList[i]?.appNotificationTitle }
appNotificationContent={ resultList[i]?.appNotificationContent }
appNotificationLink={ resultList[i]?.appNotificationLink }
></AlarmItem>
);
}
return rs;
};
useEffect(() => {
callList();
}, [selectedCategory]);
}, [appNotificationCategory]);
return (
<>
<div className="notice-box sub">