알림함 카테고리 셋팅

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

@@ -4,6 +4,7 @@ import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import moment from 'moment';
export interface AlarmItemProps {
appNotificationSequence?: number;
appNotificationCategory?: string;
notificationReceivedDate?: string;
appNotificationTitle?: string;
@@ -12,6 +13,7 @@ export interface AlarmItemProps {
};
export const AlarmItem = ({
appNotificationSequence,
appNotificationCategory,
notificationReceivedDate,
appNotificationTitle,
@@ -19,9 +21,10 @@ export const AlarmItem = ({
appNotificationLink
}: AlarmItemProps) => {
const { navigate } = useNavigate();
const onClickToNavigate = (alarmId: number) => {
let path = PATHS.support.notice.detail + alarmId;
navigate(path);
const onClickToNavigate = () => {
let path = PATHS.support.notice.detail + appNotificationSequence;
// navigate(path);
};
return (
@@ -35,7 +38,7 @@ export const AlarmItem = ({
</div>
<div
className="notice-arrow"
onClick={ () => onClickToNavigate(4) }
onClick={ () => onClickToNavigate() }
>
<img
src={ IMAGE_ROOT + '/Forward.svg' }

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">