From 2c6445ae967da93496d03bf0eaca7a160bd5843e Mon Sep 17 00:00:00 2001 From: NEWJIN Date: Mon, 15 Jul 2024 10:21:22 +0900 Subject: [PATCH 1/9] =?UTF-8?q?=20FE-61=20=F0=9F=94=A8=20eslint=20?= =?UTF-8?q?=EA=B7=9C=EC=B9=99=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index cb854af6..a373fb94 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -30,6 +30,8 @@ module.exports = { 'react/jsx-props-no-spreading': 'off', 'no-use-before-define': 'off', '@typescript-eslint/no-use-before-define': ['off'], + "react/require-default-props": 'off', + "react/self-closing-comp": 'off', }, settings: { react: { From 2ddc39819c975c0ede520a509f0b370d6e21e4f0 Mon Sep 17 00:00:00 2001 From: NEWJIN Date: Mon, 15 Jul 2024 10:22:24 +0900 Subject: [PATCH 2/9] =?UTF-8?q?FE-61=20=F0=9F=94=A5=20InteractiveEmotionIc?= =?UTF-8?q?onCard=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 단순 래핑 기능밖에 없는 컴포넌트 삭제 / emotionselector에서 emotioniconcard를 직접 사용하도록 수정 --- src/components/Emotion/card/EmotionSelector.tsx | 4 ++-- .../Emotion/card/InteractiveEmotionIconCard.tsx | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 src/components/Emotion/card/InteractiveEmotionIconCard.tsx diff --git a/src/components/Emotion/card/EmotionSelector.tsx b/src/components/Emotion/card/EmotionSelector.tsx index 29b3f104..ace202d4 100644 --- a/src/components/Emotion/card/EmotionSelector.tsx +++ b/src/components/Emotion/card/EmotionSelector.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import InteractiveEmotionIconCard from '@/components/Emotion/card/InteractiveEmotionIconCard'; +import EmotionIconCard from '@/components/Emotion/card/EmotionIconCard'; import useMediaQuery from '@/hooks/useMediaQuery'; import { EmotionType, EmotionState } from '@/types/EmotionTypes'; @@ -52,7 +52,7 @@ function EmotionSelector() { return (
{(['감동', '기쁨', '고민', '슬픔', '분노'] as const).map((iconType) => ( - handleCardClick(iconType)} /> + handleCardClick(iconType)} /> ))}
); diff --git a/src/components/Emotion/card/InteractiveEmotionIconCard.tsx b/src/components/Emotion/card/InteractiveEmotionIconCard.tsx deleted file mode 100644 index f8448315..00000000 --- a/src/components/Emotion/card/InteractiveEmotionIconCard.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import EmotionIconCard from '@/components/Emotion/card/EmotionIconCard'; -import { InteractiveEmotionIconCardProps } from '@/types/EmotionTypes'; - -// InteractiveEmotionIconCard 컴포넌트 함수 선언 -function InteractiveEmotionIconCard(props: InteractiveEmotionIconCardProps) { - return ; -} - -InteractiveEmotionIconCard.displayName = 'InteractiveEmotionIconCard'; - -export default InteractiveEmotionIconCard; From 3a0e0a028b8c67229c34b71cc42dee2ce2a0eac3 Mon Sep 17 00:00:00 2001 From: NEWJIN Date: Mon, 15 Jul 2024 10:23:25 +0900 Subject: [PATCH 3/9] =?UTF-8?q?FE-61=20=F0=9F=94=A8=20EpigramCard=20?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=EC=A6=88=20=EC=9E=AC=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit base -> xs로 변경 --- src/components/Card/EpigramCard.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/Card/EpigramCard.tsx b/src/components/Card/EpigramCard.tsx index 6fb71f86..c0cd5bc0 100644 --- a/src/components/Card/EpigramCard.tsx +++ b/src/components/Card/EpigramCard.tsx @@ -1,9 +1,9 @@ import React from 'react'; // figma 상으로는 sm ~ 3xl 사이즈로 구현되어 있는데, tailwind 환경을 반영해 -// base ~ 2xl 으로 정의했습니다. +// xs ~ 2xl 으로 정의했습니다. const sizeStyles = { - base: 'w-[286px] max-h-[132px]', + xs: 'w-[286px] max-h-[132px]', sm: 'sm:w-[312px] sm:max-h-[152px]', md: 'md:w-[384px] md:max-h-[180px]', lg: 'lg:w-[540px] lg:max-h-[160px]', @@ -12,7 +12,7 @@ const sizeStyles = { }; const textSizeStyles = { - base: 'text-xs', + xs: 'text-xs', sm: 'sm:text-sm', md: 'md:text-base', lg: 'lg:text-xl', @@ -22,19 +22,19 @@ const textSizeStyles = { function EpigramCard() { return ( -
+
{/* eslint-disable-next-line */}
{/* 줄무늬를 만들려면 비어있는 div가 필요합니다. */}
오랫동안 꿈을 그리는 사람은 마침내 그 꿈을 닮아 간다.
- 앙드레 말로 -
@@ -43,12 +43,12 @@ function EpigramCard() {
#나아가야할때
#꿈을이루고싶을때
From 6dd4a488571ddde165024d3ebecd073f17df6ab4 Mon Sep 17 00:00:00 2001 From: NEWJIN Date: Mon, 15 Jul 2024 10:24:57 +0900 Subject: [PATCH 4/9] =?UTF-8?q?FE-61=20=F0=9F=93=9D=20=EA=B3=B5=EC=9A=A9?= =?UTF-8?q?=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Card/CommentCard.tsx | 11 +++++++++-- src/components/Card/EpigramCard.tsx | 5 ++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/Card/CommentCard.tsx b/src/components/Card/CommentCard.tsx index 3975f828..db867651 100644 --- a/src/components/Card/CommentCard.tsx +++ b/src/components/Card/CommentCard.tsx @@ -17,8 +17,14 @@ function CommentCard({ status }: CommentCardProps) {
-
지킬과 하이드
-
1시간 전
+
+ {/* 테스트 텍스트입니다. */} + 지킬과 하이드 +
+
+ {/* 테스트 텍스트입니다. */} + 1시간 전 +
{status === 'edit' && (
@@ -30,6 +36,7 @@ function CommentCard({ status }: CommentCardProps) {
+ {/* 테스트 텍스트입니다. */} 오늘 하루 우울했었는데 덕분에 많은 힘 얻고 갑니다. 연금술사 책 다시 사서 오랜만에 읽어봐야겠어요!
diff --git a/src/components/Card/EpigramCard.tsx b/src/components/Card/EpigramCard.tsx index c0cd5bc0..07ceb392 100644 --- a/src/components/Card/EpigramCard.tsx +++ b/src/components/Card/EpigramCard.tsx @@ -31,12 +31,13 @@ function EpigramCard() {
+ {/* 테스트 텍스트입니다. */} 오랫동안 꿈을 그리는 사람은 마침내 그 꿈을 닮아 간다.
- - 앙드레 말로 - + {/* 테스트 텍스트입니다. */}- 앙드레 말로 -
@@ -45,11 +46,13 @@ function EpigramCard() {
+ {/* 테스트 텍스트입니다. */} #나아가야할때
+ {/* 테스트 텍스트입니다. */} #꿈을이루고싶을때
From 78d6bd0673c556196433024c6c9affe028d9e6ac Mon Sep 17 00:00:00 2001 From: NEWJIN Date: Mon, 15 Jul 2024 10:25:35 +0900 Subject: [PATCH 5/9] =?UTF-8?q?FE-61=20=F0=9F=94=A8=20CommentCard=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EB=82=B4=EB=B6=80=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Card/CommentCard.tsx | 5 ++++- src/types/CommentCardTypes.ts | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 src/types/CommentCardTypes.ts diff --git a/src/components/Card/CommentCard.tsx b/src/components/Card/CommentCard.tsx index db867651..a58f0e6f 100644 --- a/src/components/Card/CommentCard.tsx +++ b/src/components/Card/CommentCard.tsx @@ -1,8 +1,11 @@ import React from 'react'; import Image from 'next/image'; -import { CommentCardProps } from '@/types/CommentCardTypes'; import { sizeStyles, textSizeStyles, gapStyles, paddingStyles, contentWidthStyles } from '@/styles/CommentCardStyles'; +export interface CommentCardProps { + status: 'edit' | 'complete'; +} + function CommentCard({ status }: CommentCardProps) { return (
Date: Mon, 15 Jul 2024 10:26:51 +0900 Subject: [PATCH 6/9] =?UTF-8?q?FE-61=20:truck:=20=EA=B0=90=EC=A0=95=20?= =?UTF-8?q?=EC=B9=B4=EB=93=9C=20=ED=8F=B4=EB=8D=94=20=EA=B5=AC=EC=A1=B0=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Emotion/{card => }/EmotionIconCard.tsx | 0 src/components/Emotion/{card => }/EmotionSelector.tsx | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/components/Emotion/{card => }/EmotionIconCard.tsx (100%) rename src/components/Emotion/{card => }/EmotionSelector.tsx (100%) diff --git a/src/components/Emotion/card/EmotionIconCard.tsx b/src/components/Emotion/EmotionIconCard.tsx similarity index 100% rename from src/components/Emotion/card/EmotionIconCard.tsx rename to src/components/Emotion/EmotionIconCard.tsx diff --git a/src/components/Emotion/card/EmotionSelector.tsx b/src/components/Emotion/EmotionSelector.tsx similarity index 100% rename from src/components/Emotion/card/EmotionSelector.tsx rename to src/components/Emotion/EmotionSelector.tsx From 3732b6fb27ff91f237163c90f270a7f8ffcbd462 Mon Sep 17 00:00:00 2001 From: NEWJIN Date: Mon, 15 Jul 2024 10:27:58 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=20FE-61=20=F0=9F=93=9D=20=EA=B0=90?= =?UTF-8?q?=EC=A0=95=20=EC=B9=B4=EB=93=9C,=20=EA=B0=90=EC=A0=95=20?= =?UTF-8?q?=EC=85=80=EB=A0=89=ED=84=B0=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Emotion/{EmotionIconCard.tsx => EmotionCard.tsx} | 6 ++++++ src/components/Emotion/EmotionSelector.tsx | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) rename src/components/Emotion/{EmotionIconCard.tsx => EmotionCard.tsx} (93%) diff --git a/src/components/Emotion/EmotionIconCard.tsx b/src/components/Emotion/EmotionCard.tsx similarity index 93% rename from src/components/Emotion/EmotionIconCard.tsx rename to src/components/Emotion/EmotionCard.tsx index a230deec..ce14ccd3 100644 --- a/src/components/Emotion/EmotionIconCard.tsx +++ b/src/components/Emotion/EmotionCard.tsx @@ -1,3 +1,9 @@ +/* + 1개의 감정 아이콘 카드를 랜더링 합니다. + 아이콘의 타입, 상태, 크기, 클릭 이벤트를 관리합니다. + 아이콘 타입과 상태에 따라 아이콘의 모양과 스타일을 조정합니다. + */ + import React from 'react'; import cn from '@/lib/utils'; import Image from 'next/image'; diff --git a/src/components/Emotion/EmotionSelector.tsx b/src/components/Emotion/EmotionSelector.tsx index ace202d4..5a73639e 100644 --- a/src/components/Emotion/EmotionSelector.tsx +++ b/src/components/Emotion/EmotionSelector.tsx @@ -1,5 +1,10 @@ +/* + 여러 개의 EmotionIconCard를 관리합니다. + 사용자 인터페이스에 필요한 상호 작용 로직을 포함합니다. + */ + import React, { useState } from 'react'; -import EmotionIconCard from '@/components/Emotion/card/EmotionIconCard'; +import EmotionIconCard from '@/components/Emotion/EmotionCard'; import useMediaQuery from '@/hooks/useMediaQuery'; import { EmotionType, EmotionState } from '@/types/EmotionTypes'; From a2ba4b3700c15754693ce3bb488edb7aa9b33eb5 Mon Sep 17 00:00:00 2001 From: NEWJIN Date: Mon, 15 Jul 2024 10:45:32 +0900 Subject: [PATCH 8/9] =?UTF-8?q?FE-61=20:fire:=20=EB=8C=93=EA=B8=80=20?= =?UTF-8?q?=EC=B9=B4=EB=93=9C=20=EB=94=94=ED=8F=B4=ED=8A=B8=20=ED=94=84?= =?UTF-8?q?=EB=A1=AD=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Emotion/EmotionCard.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/Emotion/EmotionCard.tsx b/src/components/Emotion/EmotionCard.tsx index ce14ccd3..1896f7cd 100644 --- a/src/components/Emotion/EmotionCard.tsx +++ b/src/components/Emotion/EmotionCard.tsx @@ -110,11 +110,4 @@ function EmotionIconCard({ iconType = '감동', state = 'Default', size = 'sm', ); } -EmotionIconCard.displayName = 'EmotionIconCard'; - -// 기본 props 설정 -EmotionIconCard.defaultProps = { - onClick: () => {}, -}; - export default EmotionIconCard; From 8dd99faa30a1456576747d11100332a007e08e19 Mon Sep 17 00:00:00 2001 From: imsoohyeok <160010477+imsoohyeok@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:08:27 +0900 Subject: [PATCH 9/9] =?UTF-8?q?FE-62=20=E2=9C=A8fix:=20=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=ED=83=80=EC=9E=85?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20(#27)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header/Header.tsx | 32 ++++++++++++++++++++++---------- src/types/Header.ts | 12 ------------ 2 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 src/types/Header.ts diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 5c893fed..d342347f 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { useRouter } from 'next/router'; import Image from 'next/image'; -import { HeaderProps } from '../../types/Header'; import { useToast } from '../ui/use-toast'; import LOGO_ICON from '../../../public/epigram-icon.png'; import ARROW_LEFT_ICON from '../../../public/icon/arrow-left-icon.svg'; @@ -9,15 +8,28 @@ import PROFILE_ICON from '../../../public/icon/profile-icon.svg'; import SEARCH_ICON from '../../../public/icon/search-icon.svg'; import SHARE_ICON from '../../../public/icon/share-icon.svg'; -// TODO 네비게이션 바를 나타내는 컴포넌트 입니다. -// TODO 상위 컴포넌트에서 Props를 받아 원하는 스타일을 보여줍니다. -// TODO 사용 예시 -// TODO
-// TODO
{}} />; -// TODO icon: 'back'을 사용할 경우 routerPage의 값을 무조건 지정해줘야 합니다. -// TODO isLogo={false}일 경우 insteadOfLogo의 값을 무조건 지정해줘야 합니다. -// TODO isButton 일 경우 textInButton의 값을 무조건 지정해줘야 합니다. -// TODO SHARE_ICON 추가 시 토스트 기능도 사용하려면 해당 컴포넌트 아래 를 추가해주세요. +// NOTE 네비게이션 바를 나타내는 컴포넌트 입니다. +// NOTE 상위 컴포넌트에서 Props를 받아 원하는 스타일을 보여줍니다. +// NOTE 사용 예시 +// NOTE
+// NOTE
{}} />; +// NOTE icon: 'back'을 사용할 경우 routerPage의 값을 무조건 지정해줘야 합니다. +// NOTE isLogo={false}일 경우 insteadOfLogo의 값을 무조건 지정해줘야 합니다. +// NOTE isButton 일 경우 textInButton의 값을 무조건 지정해줘야 합니다. +// NOTE SHARE_ICON 추가 시 토스트 기능도 사용하려면 해당 컴포넌트 아래 를 추가해주세요. + +export interface HeaderProps { + icon: 'back' | 'search' | ''; + routerPage: string; + isLogo: boolean; + insteadOfLogo: string; + isProfileIcon: boolean; + isShareIcon: boolean; + isButton: boolean; + textInButton: string; + disabled: boolean; + onClick: (e: React.MouseEvent) => void; +} function Header({ isLogo, icon, insteadOfLogo, isButton, isProfileIcon, isShareIcon, textInButton, routerPage, disabled, onClick }: HeaderProps) { const router = useRouter(); diff --git a/src/types/Header.ts b/src/types/Header.ts deleted file mode 100644 index a75d1fce..00000000 --- a/src/types/Header.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface HeaderProps { - icon: 'back' | 'search' | ''; - routerPage: string; - isLogo: boolean; - insteadOfLogo: string; - isProfileIcon: boolean; - isShareIcon: boolean; - isButton: boolean; - textInButton: string; - disabled: boolean; - onClick: (e: React.MouseEvent) => void; -}