Skip to content

Commit

Permalink
Fix: 일기 없을 때 레이아웃 추가 (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunn522 authored Feb 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 99c2cf3 commit 4ded4bf
Showing 2 changed files with 21 additions and 10 deletions.
12 changes: 12 additions & 0 deletions src/pages/Home/Home.module.scss
Original file line number Diff line number Diff line change
@@ -65,3 +65,15 @@
}
}
}

.noDiaryContainer {
position: absolute;
width: 100%;
height: 90%;
display: flex;
justify-content: center;
align-items: center;

@include body16;
color: $BK70;
}
19 changes: 9 additions & 10 deletions src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
@@ -44,16 +44,9 @@ const Home = () => {
error: listError,
data: diaryListData,
} = useQuery({
queryKey: [
'diary',
currentDate.getFullYear(),
currentDate.getMonth() + 1,
],
queryKey: ['diary', currentDate.getFullYear(), currentDate.getMonth() + 1],
queryFn: () =>
getDiaryList(
currentDate.getFullYear(),
currentDate.getMonth() + 1,
),
getDiaryList(currentDate.getFullYear(), currentDate.getMonth() + 1),
});

const { error: streakError, data: streakDateData } = useQuery({
@@ -118,7 +111,13 @@ const Home = () => {
diaryList ? (
<List dataList={diaryList} isLoading={isListLoading} />
) : (
<></>
<div className={styles.noDiaryContainer}>
<div className={styles.noDiary}>
해당되는 일기가 없어요!
<br />
다른 달로 변경해보세요
</div>
</div>
)
) : (
<HomeCalendar

0 comments on commit 4ded4bf

Please sign in to comment.