Skip to content

Commit 2f5e99e

Browse files
authored
fix: 랜딩페이지 렌더링 이슈 해결 (#304)
* refactor: 북마크 아이콘이 분기되는 로직이 비로그인 상태에서는 적용되지 않도록 수정합니다. * fix: 비로그인 상태에서는 카드 컴포넌트에 북마크 아이콘이 출력됩니다.
1 parent f17e265 commit 2f5e99e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/pages/LandingPage/LandingPage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ import { ToggleGroupValue } from '@/types/toggle';
2222
import { NOTICE, SUCCESS } from '@/constants/message';
2323
import { useTodayBalanceGameList } from '@/hooks/game/useTodayBalanceGameList';
2424
import { todayTalkPickDummyData } from '@/mocks/data/banner';
25+
import { PATH } from '@/constants/path';
2526
import * as S from './LandingPage.style';
2627

2728
const LandingPage = () => {
2829
const isMobile = useIsMobile();
2930
const navigate = useNavigate();
30-
const { isOpen: isLoginModalOpen, openModal, closeModal } = useModal();
31+
const { isOpen: isLoginModalOpen, closeModal } = useModal();
3132
const { isVisible, modalText, showToastModal } = useToastModal();
3233

3334
const { member } = useMemberQuery();
@@ -63,10 +64,9 @@ const LandingPage = () => {
6364
}, [isBestGamesEnabled, isLatestGamesEnabled, bestGames, latestGames]);
6465

6566
const processedContents = useMemo(() => {
66-
if (!member?.id) return [];
6767
return contents.map((item: GameContent) => ({
6868
...item,
69-
showBookmark: item.writerId !== member.id,
69+
showBookmark: member?.id ? item.writerId !== member.id : true,
7070
}));
7171
}, [contents, member?.id]);
7272

@@ -95,7 +95,7 @@ const LandingPage = () => {
9595
if (!content.id) return;
9696

9797
if (!isLoggedIn()) {
98-
openModal();
98+
navigate(`/${PATH.LOGIN}`);
9999
return;
100100
}
101101

@@ -113,7 +113,7 @@ const LandingPage = () => {
113113
});
114114
}
115115
},
116-
[createBookmark, deleteBookmark, openModal, showToastModal],
116+
[createBookmark, deleteBookmark, navigate, showToastModal],
117117
);
118118

119119
return (

0 commit comments

Comments
 (0)