Skip to content

Commit

Permalink
Merge pull request #160 from Team-Lecue/feature/DetailPage
Browse files Browse the repository at this point in the history
[ DetailPage ] dev 머지 PR입니다!
  • Loading branch information
jungwoo3490 authored Jan 18, 2024
2 parents 0dd1fcf + 452c4f9 commit 665517a
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 6 deletions.
21 changes: 21 additions & 0 deletions src/Detail/components/EmptyView/EmptyView.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styled from '@emotion/styled';

export const EmptyViewWrapper = styled.div`
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100%;
height: calc(100vh - 39rem);
`;

export const EmptyViewTextWrapper = styled.div`
text-align: center;
margin-top: 2.1rem;
`;

export const EmptyViewText = styled.p`
color: ${({ theme }) => theme.colors.MG};
${({ theme }) => theme.fonts.Body3_R_14};
`;
16 changes: 16 additions & 0 deletions src/Detail/components/EmptyView/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { ImgEmpty } from '../../../assets';
import * as S from './EmptyView.style';

function EmptyView() {
return (
<S.EmptyViewWrapper>
<ImgEmpty />
<S.EmptyViewTextWrapper>
<S.EmptyViewText>아직 레큐노트가 없습니다.</S.EmptyViewText>
<S.EmptyViewText>가장 먼저 작성해보세요!</S.EmptyViewText>
</S.EmptyViewTextWrapper>
</S.EmptyViewWrapper>
);
}

export default EmptyView;
13 changes: 7 additions & 6 deletions src/Detail/components/LecueNoteListContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import Button from '../../../components/common/Button';
import usePostStickerState from '../../../StickerAttach/hooks/usePostStickerState';
import { NoteType, postedStickerType } from '../../type/lecueBookType';
import EmptyView from '../EmptyView';
import LecueNoteListHeader from '../LecueNoteLIstHeader';
import LinearView from '../LinearView';
import ZigZagView from '../ZigZagView';
Expand Down Expand Up @@ -120,7 +121,9 @@ function LecueNoteListContainer({
buttonOnClick={() => setIsZigZagView(!isZigZagView)}
/>
<S.LecueNoteListViewWrapper>
{isZigZagView ? (
{noteList.length === 0 ? (
<EmptyView />
) : isZigZagView ? (
<ZigZagView
savedScrollPosition={savedScrollPosition}
noteList={noteList}
Expand All @@ -138,11 +141,9 @@ function LecueNoteListContainer({
{!isEditable && (
<>
<S.StickerButton type="button" onClick={handleClickStickerButton}>
{backgroundColor === '#F5F5F5' ? (
<BtnFloatingSticker />
) : (
<BtnFloatingStickerOrange />
)}
{backgroundColor === '#F5F5F5'
? noteList.length !== 0 && <BtnFloatingSticker />
: noteList.length !== 0 && <BtnFloatingStickerOrange />}
</S.StickerButton>
<S.WriteButton type="button" onClick={handleClickWriteButton}>
{backgroundColor === '#F5F5F5' ? (
Expand Down
10 changes: 10 additions & 0 deletions src/assets/img/img_empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/assets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import ImgBook from './img/img_book.svg?react';
import ImgBookBackgray from './img/img_book_backgray.svg?react';
import ImgBookOrange from './img/img_book_orange.svg?react';
import ImgBookOrangeBig from './img/img_book_orange_big.svg?react';
import ImgEmpty from './img/img_empty.svg?react';
import ImgError from './img/img_error.svg?react';
import ImgEvent from './img/img_event.svg?react';
import ImgKakao01 from './img/img_kakao_01.svg?react';
Expand Down Expand Up @@ -67,6 +68,7 @@ export {
ImgBookBackgray,
ImgBookOrange,
ImgBookOrangeBig,
ImgEmpty,
ImgError,
ImgEvent,
ImgKakao01,
Expand Down

0 comments on commit 665517a

Please sign in to comment.