diff --git a/apps/client/src/pages/myBookmark/MyBookmark.tsx b/apps/client/src/pages/myBookmark/MyBookmark.tsx index 2007e169..708cc93e 100644 --- a/apps/client/src/pages/myBookmark/MyBookmark.tsx +++ b/apps/client/src/pages/myBookmark/MyBookmark.tsx @@ -19,6 +19,7 @@ import { useDeleteRemindArticle, usePutArticleReadStatus, } from '@shared/apis/queries'; +import NoUnreadArticles from '@pages/myBookmark/components/noUnreadArticles/NoUnreadArticles'; const MyBookmark = () => { const [activeBadge, setActiveBadge] = useState<'all' | 'notRead'>('all'); @@ -82,8 +83,15 @@ const MyBookmark = () => { setActiveBadge(badgeType); }; + const EmptyStateComponent = () => { + if (articles?.totalArticle === 0) { + return ; + } + return ; + }; + return ( -
+

나의 북마크

@@ -116,7 +124,7 @@ const MyBookmark = () => {
{articlesToDisplay && articlesToDisplay.length > 0 ? ( -
+
{articlesToDisplay.map((article) => ( { ))}
) : ( - + )} { + return ( +
+ No Articles + +

저장된 정보를 모두 꺼내봤어요!

+

+ 치삐가 다음 도토리를 기다리고 있어요 +

+
+ ); +}; + +export default NoUnreadArticles; diff --git a/apps/client/src/pages/remind/Remind.tsx b/apps/client/src/pages/remind/Remind.tsx index 1c846fe8..a0aec067 100644 --- a/apps/client/src/pages/remind/Remind.tsx +++ b/apps/client/src/pages/remind/Remind.tsx @@ -15,6 +15,7 @@ import { useGetArticleDetail, } from '@shared/apis/queries'; import { useQueryClient } from '@tanstack/react-query'; +import NoRemindArticles from './components/noRemindArticles/NoRemindArticles'; const Remind = () => { const [isEditOpen, setIsEditOpen] = useState(false); @@ -25,7 +26,7 @@ const Remind = () => { const { mutate: updateToReadStatus } = usePutArticleReadStatus(); const { mutate: deleteArticle } = useDeleteRemindArticle(); - const { data } = useGetRemindArticles( + const { data, isPending } = useGetRemindArticles( formattedDate, activeBadge === 'read', 1, @@ -61,11 +62,21 @@ const Remind = () => { setActiveBadge(badgeType); }; - const EmptyStateComponent = - activeBadge === 'read' ? : ; + const EmptyStateComponent = () => { + if (data?.readArticleCount === 0 && data?.unreadArticleCount === 0) { + return ; + } + + return activeBadge === 'read' ? : ; + }; + + // TODO: 로딩 상태 디자인 필요 + if (isPending) { + return
Loading...
; + } return ( -
+

리마인드

{
{data?.articles && data.articles.length > 0 ? ( -
+
{data.articles.map((article) => ( { ))}
) : ( - EmptyStateComponent + )} {

앗..

- 저장된 정보가 없어요 + 리마인드에서 안 읽은 북마크를 확인해 보세요.

); diff --git a/apps/client/src/pages/remind/components/noRemindArticles/NoRemindArticles.tsx b/apps/client/src/pages/remind/components/noRemindArticles/NoRemindArticles.tsx new file mode 100644 index 00000000..057fbcd5 --- /dev/null +++ b/apps/client/src/pages/remind/components/noRemindArticles/NoRemindArticles.tsx @@ -0,0 +1,16 @@ +import chippiNoArticles from '@assets/chippi_x.svg'; + +const NoRemindArticles = () => { + return ( +
+ No Articles + +

앗..

+

+ 저장된 정보가 없어요 +

+
+ ); +}; + +export default NoRemindArticles; diff --git a/apps/client/src/shared/components/optionsMenuButton/OptionsMenuButton.tsx b/apps/client/src/shared/components/optionsMenuButton/OptionsMenuButton.tsx index ab30056e..9c7ddc86 100644 --- a/apps/client/src/shared/components/optionsMenuButton/OptionsMenuButton.tsx +++ b/apps/client/src/shared/components/optionsMenuButton/OptionsMenuButton.tsx @@ -9,7 +9,7 @@ export interface OptionsMenuButtonProps { const ITEM_STYLE = 'body4-r text-font-black-1 h-[3.6rem] w-full ' + - 'flex items-center justify-center ' + + 'flex items-center pl-[0.8rem] ' + 'hover:bg-gray100 focus-visible:bg-gray100 active:bg-gray200 ' + 'outline-none transition-colors'; diff --git a/apps/client/src/shared/components/sidebar/SideItem.tsx b/apps/client/src/shared/components/sidebar/SideItem.tsx index 02907c0a..6db49b9d 100644 --- a/apps/client/src/shared/components/sidebar/SideItem.tsx +++ b/apps/client/src/shared/components/sidebar/SideItem.tsx @@ -34,7 +34,7 @@ export default function SideItem({
-
+
@@ -119,7 +119,6 @@ export function Sidebar() { label="리마인드" active={activeTab === 'remind'} onClick={() => { - setSelectedCategoryId(null); closeMenu(); goRemind(); }} @@ -131,7 +130,6 @@ export function Sidebar() { active={activeTab === 'mybookmark'} defaultOpen onClick={() => { - setSelectedCategoryId(null); closeMenu(); goBookmarks(); }} diff --git a/packages/design-system/src/components/card/BaseCard.tsx b/packages/design-system/src/components/card/BaseCard.tsx index 122fcf8a..cea96898 100644 --- a/packages/design-system/src/components/card/BaseCard.tsx +++ b/packages/design-system/src/components/card/BaseCard.tsx @@ -1,13 +1,19 @@ +import { cn } from '../../lib'; + interface BaseCardProps { onClick?: () => void; children: React.ReactNode; + className?: string; } -const BaseCard = ({ children, onClick }: BaseCardProps) => { +const BaseCard = ({ children, onClick, className }: BaseCardProps) => { return (
{children}
diff --git a/packages/design-system/src/components/card/MyBookmarkCard.tsx b/packages/design-system/src/components/card/MyBookmarkCard.tsx index d5b89b73..e0211c3d 100644 --- a/packages/design-system/src/components/card/MyBookmarkCard.tsx +++ b/packages/design-system/src/components/card/MyBookmarkCard.tsx @@ -22,7 +22,7 @@ const MyBookmarkCard = ({ onOptionsClick, }: MyBookmarkCardProps) => { return ( - +
{imageUrl ? ( diff --git a/packages/design-system/src/components/card/RemindCard.tsx b/packages/design-system/src/components/card/RemindCard.tsx index b6e49cfc..e0432a28 100644 --- a/packages/design-system/src/components/card/RemindCard.tsx +++ b/packages/design-system/src/components/card/RemindCard.tsx @@ -22,7 +22,7 @@ const RemindCard = ({ onOptionsClick, }: RemindCardProps) => { return ( - +