diff --git a/src/entities/alarm/model/types.ts b/src/entities/alarm/model/types.ts index 67fbaf1..afe7b79 100644 --- a/src/entities/alarm/model/types.ts +++ b/src/entities/alarm/model/types.ts @@ -1,5 +1,6 @@ export interface AlarmItemProps { title?: string, + name?: string, category?: string, date?: string }; \ No newline at end of file diff --git a/src/entities/alarm/ui/alarm-item.tsx b/src/entities/alarm/ui/alarm-item.tsx index 2c0952b..f81abf1 100644 --- a/src/entities/alarm/ui/alarm-item.tsx +++ b/src/entities/alarm/ui/alarm-item.tsx @@ -5,6 +5,7 @@ import { AlarmItemProps } from '../model/types'; export const AlarmItem = ({ title, + name, category, date }: AlarmItemProps) => { @@ -19,7 +20,7 @@ export const AlarmItem = ({
{ title }
- { category } + { name } { date }
diff --git a/src/entities/alarm/ui/alarm-list.tsx b/src/entities/alarm/ui/alarm-list.tsx index 9977c77..d3658c0 100644 --- a/src/entities/alarm/ui/alarm-list.tsx +++ b/src/entities/alarm/ui/alarm-list.tsx @@ -2,37 +2,46 @@ import { IMAGE_ROOT } from '@/shared/constants/common'; import { AlarmItem } from './alarm-item'; import { AlarmItemProps } from '../model/types'; +export interface AlarmListProps { + category: string; +}; -export const AlarmList = () => { +export const AlarmList = ({ + category +}: AlarmListProps) => { const alarmItems: Array = [ - {title: '시스템 안정화를 위한 정기 점검이 예정되어 있습니다.', category: '공지사항', date: '2025.06.01 10:00:00'}, - {title: '가맹점 관리 메뉴에 거래내역 엑셀 다운로드 기능이 추가 되었습니다.', category: '공지사항', date: '2025.06.01 10:00:00'}, - {title: '신규 가맹점을 대상으로 거래수수료 인하 혜택을 12월까지 제공합니다.', category: '공지사항', date: '2025.06.01 10:00:00'}, - {title: '앱의 안정성과 사용성을 개선한 버전 2.3.1이 출시되었습니다.', category: '공지사항', date: '2025.06.01 10:00:00'}, - {title: '점검 시간 동안 일부 서비스 이용이 제한될 수 있으니 미리 확인해주세요.', category: '공지사항', date: '2025.06.01 10:00:00'}, - {title: '가맹점 관리 메뉴에 거래내역 엑셀 다운로드 기능이 추가 되었습니다.', category: '공지사항', date: '2025.06.01 10:00:00'}, - {title: '신규 가맹점을 대상으로 거래수수료 인하 혜택을 12월까지 제공합니다.', category: '공지사항', date: '2025.06.01 10:00:00'}, - {title: '앱의 안정성과 사용성을 개선한 버전 2.3.1이 출시되었습니다.', category: '공지사항', date: '2025.06.01 10:00:00'}, - {title: '점검 시간 동안 일부 서비스 이용이 제한될 수 있으니 미리 확인해주세요.', category: '공지사항', date: '2025.06.01 10:00:00'}, + {title: '시스템 안정화를 위한 정기 점검이 예정되어 있습니다.', name: '공지사항', category: 'notice', date: '2025.06.01 10:00:00'}, + {title: '가맹점 관리 메뉴에 거래내역 엑셀 다운로드 기능이 추가 되었습니다.', name: '공지사항', category: 'notice', date: '2025.06.01 10:00:00'}, + {title: '신규 가맹점을 대상으로 거래수수료 인하 혜택을 12월까지 제공합니다.', name: '공지사항', category: 'notice', date: '2025.06.01 10:00:00'}, + {title: '앱의 안정성과 사용성을 개선한 버전 2.3.1이 출시되었습니다.', name: '공지사항', category: 'notice', date: '2025.06.01 10:00:00'}, + {title: '점검 시간 동안 일부 서비스 이용이 제한될 수 있으니 미리 확인해주세요.', name: '공지사항', category: 'notice', date: '2025.06.01 10:00:00'}, + {title: '가맹점 관리 메뉴에 거래내역 엑셀 다운로드 기능이 추가 되었습니다.', name: '공지사항', category: 'notice', date: '2025.06.01 10:00:00'}, + {title: '신규 가맹점을 대상으로 거래수수료 인하 혜택을 12월까지 제공합니다.', name: '공지사항', category: 'notice', date: '2025.06.01 10:00:00'}, + {title: '앱의 안정성과 사용성을 개선한 버전 2.3.1이 출시되었습니다.', name: '공지사항', category: 'notice', date: '2025.06.01 10:00:00'}, + {title: '점검 시간 동안 일부 서비스 이용이 제한될 수 있으니 미리 확인해주세요.', name: '공지사항', category: 'notice', date: '2025.06.01 10:00:00'}, ]; const getAlarmItems = () => { let rs = []; for(let i=0;i - ) + if(category === 'all' || (alarmItems[i]?.category === category)){ + rs.push( + + ) + } + } return rs; }; return ( <>
- { getAlarmItems() } + { getAlarmItems() }
※ 알림은 90일간 보관 후 삭제됩니다.
diff --git a/src/pages/alarm/list/list-page.tsx b/src/pages/alarm/list/list-page.tsx index eddf815..f53aee2 100644 --- a/src/pages/alarm/list/list-page.tsx +++ b/src/pages/alarm/list/list-page.tsx @@ -5,22 +5,42 @@ import { useSetHeaderType, useSetFooterMode } from '@/widgets/sub-layout/use-sub-layout'; +import { useState } from 'react'; export const ListPage = () => { useSetHeaderTitle('알림함'); useSetHeaderType(HeaderType.LeftArrow); useSetFooterMode(false); + const [category, setCategory] = useState('all'); + + let btnList = [ + {name: '전체', category: 'all'}, + {name: '혜택/이벤트', category: 'event'}, + {name: '공지사항', category: 'notice'} + ]; + + const onClickToCategory = (value: any) => { + setCategory(value.category); + }; + return ( <>
- - - + { + btnList.map((value, index) => ( + + )) + }
- +