@@ -55,7 +55,18 @@ const Remind = () => {
5555 containerRef,
5656 } = useAnchoredMenu ( ( anchor ) => belowOf ( anchor , 8 ) ) ;
5757
58- const articlesToDisplay = data ?. pages . flatMap ( ( page ) => page . articles ) ?? [ ] ;
58+ // const articlesToDisplay = data?.pages.flatMap((page) => page.articles) ?? [];
59+
60+ const articlesToDisplay =
61+ data ?. pages
62+ . flatMap ( ( page ) => page . articles )
63+ . filter ( ( article ) => {
64+ const now = new Date ( ) . getTime ( ) ;
65+ const remindTime = new Date ( article . remindAt ) . getTime ( ) ;
66+ const displayTimeLimit = 24 * 60 * 60 * 1000 ;
67+
68+ return remindTime > now && remindTime <= now + displayTimeLimit ;
69+ } ) ?? [ ] ;
5970
6071 const getItemTitle = ( id : number | null ) =>
6172 id == null ? '' : ( REMIND_MOCK_DATA . find ( ( d ) => d . id === id ) ?. title ?? '' ) ;
@@ -97,22 +108,23 @@ const Remind = () => {
97108 return < div > Loading...</ div > ;
98109 }
99110
100- const unreadArticleCount = data ?. pages [ 0 ] ?. unreadArticleCount || 0 ;
101- const readArticleCount = data ?. pages [ 0 ] ?. readArticleCount || 0 ;
111+ // TODO: 임시
112+ // const unreadArticleCount = data?.pages[0]?.unreadArticleCount || 0;
113+ // const readArticleCount = data?.pages[0]?.readArticleCount || 0;
102114
103115 return (
104116 < div className = "flex flex-col py-[5.2rem] pl-[8rem] pr-[5rem]" >
105117 < p className = "head3" > 리마인드</ p >
106118 < div className = "mt-[3rem] flex gap-[2.4rem]" >
107119 < Badge
108120 text = "안 읽음"
109- countNum = { unreadArticleCount }
121+ // countNum={unreadArticleCount}
110122 onClick = { ( ) => handleBadgeClick ( 'notRead' ) }
111123 isActive = { activeBadge === 'notRead' }
112124 />
113125 < Badge
114126 text = "읽음"
115- countNum = { readArticleCount }
127+ // countNum={readArticleCount}
116128 onClick = { ( ) => handleBadgeClick ( 'read' ) }
117129 isActive = { activeBadge === 'read' }
118130 />
0 commit comments