From 47c2d945de8facc7af387a6ba750585388d0bdbc Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Mon, 17 Jun 2024 23:14:10 +0900 Subject: [PATCH 01/24] =?UTF-8?q?feat:=20=ED=8C=8C=EC=9D=BC=EB=93=A4=20Boo?= =?UTF-8?q?lean=20=EC=B2=98=EB=A6=AC=20(#490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/AgreeBlock/index.tsx | 4 ++-- components/Carousel/index.tsx | 6 +++--- components/DeclarationModal/index.tsx | 6 +++--- components/Portal/index.tsx | 2 +- components/Setting/WithdrawBlock/index.tsx | 4 ++-- components/TabView/Tabs/index.tsx | 2 +- pages/agree/index.tsx | 6 +++--- pages/with-draw/index.tsx | 10 +++++----- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/components/AgreeBlock/index.tsx b/components/AgreeBlock/index.tsx index 3ddee3d2..99b8f7e3 100644 --- a/components/AgreeBlock/index.tsx +++ b/components/AgreeBlock/index.tsx @@ -9,8 +9,8 @@ import { Dispatch, SetStateAction, useEffect, useState } from 'react'; interface AgreeBlockProps { title: string; buttonClick?: () => void; - checked: boolean; - setChecked: Dispatch>; + checked: Boolean; + setChecked: Dispatch>; lastItem?: Boolean; } diff --git a/components/Carousel/index.tsx b/components/Carousel/index.tsx index 1c883e43..f8d5341f 100644 --- a/components/Carousel/index.tsx +++ b/components/Carousel/index.tsx @@ -9,8 +9,8 @@ interface CarouselProps { ParentRef?: React.MutableRefObject; afterChange?: (currentIndex: number) => void; beforeChange?: (currentIndex: number, nextIndex: number) => void; - swipe?: boolean; - dots?: boolean; + swipe?: Boolean; + dots?: Boolean; initialSlide?: number; } @@ -26,7 +26,7 @@ export default function Carousel({ }: CarouselProps) { const sliderSettings = { speed: 400, - infinite: infinite as boolean, //무한 슬라이드 true, + infinite: infinite as Boolean, //무한 슬라이드 true, slidesToShow: slidesToShow, afterChange, beforeChange, diff --git a/components/DeclarationModal/index.tsx b/components/DeclarationModal/index.tsx index c3652de6..07dbea36 100644 --- a/components/DeclarationModal/index.tsx +++ b/components/DeclarationModal/index.tsx @@ -30,7 +30,7 @@ export default function DeclarationModal({ setReceivedDeclaration, setReportStatus, }: DeclarationModalProps) { - const [checks, setChecks] = useState>([ + const [checks, setChecks] = useState>([ false, false, false, @@ -40,7 +40,7 @@ export default function DeclarationModal({ false, false, ]); - const [possible, setPossible] = useState(false); + const [possible, setPossible] = useState(false); useEffect(() => { setPossible(checks.some((check) => check)); @@ -63,7 +63,7 @@ export default function DeclarationModal({ const onClickDeclarationButton = async () => { const trueIndices: number[] = checks.reduce( - (acc: number[], currentValue: boolean, currentIndex: number) => { + (acc: number[], currentValue: Boolean, currentIndex: number) => { if (currentValue === true) { acc.push(currentIndex); } diff --git a/components/Portal/index.tsx b/components/Portal/index.tsx index 74475817..19c7bc05 100644 --- a/components/Portal/index.tsx +++ b/components/Portal/index.tsx @@ -2,7 +2,7 @@ import React, { ReactElement, useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; const Portal = ({ children }: { children: ReactElement }) => { - const [mounted, setMounted] = useState(false); + const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); diff --git a/components/Setting/WithdrawBlock/index.tsx b/components/Setting/WithdrawBlock/index.tsx index b73b2d2d..103c4c2d 100644 --- a/components/Setting/WithdrawBlock/index.tsx +++ b/components/Setting/WithdrawBlock/index.tsx @@ -11,8 +11,8 @@ interface WithdrawBlockProps { content?: React.ReactNode; content2?: React.ReactNode; buttonClick?: () => void; - checked: boolean; - setChecked: Dispatch>; + checked: Boolean; + setChecked: Dispatch>; lastItem?: Boolean; } diff --git a/components/TabView/Tabs/index.tsx b/components/TabView/Tabs/index.tsx index 3b1478c0..9ee8e199 100644 --- a/components/TabView/Tabs/index.tsx +++ b/components/TabView/Tabs/index.tsx @@ -5,7 +5,7 @@ import Carousel from '@/components/Carousel'; interface TabsProps { children: React.ReactNode; - dots?: boolean; + dots?: Boolean; } export default function Tabs({ children, dots }: TabsProps) { diff --git a/pages/agree/index.tsx b/pages/agree/index.tsx index 7e9b1aef..daa96e63 100644 --- a/pages/agree/index.tsx +++ b/pages/agree/index.tsx @@ -19,10 +19,10 @@ interface ComponentWithLayout extends FC { const Agree: ComponentWithLayout = () => { const router = useRouter(); - const [check1, setCheck1] = useState(false); - const [check2, setCheck2] = useState(false); + const [check1, setCheck1] = useState(false); + const [check2, setCheck2] = useState(false); - const [possible, setPossible] = useState(false); + const [possible, setPossible] = useState(false); const [alertOpen, setAlertOpen] = useState(false); useEffect(() => { diff --git a/pages/with-draw/index.tsx b/pages/with-draw/index.tsx index bba9d69c..26de23dd 100644 --- a/pages/with-draw/index.tsx +++ b/pages/with-draw/index.tsx @@ -17,12 +17,12 @@ export default function Withdraw() { const router = useRouter(); - const [check1, setCheck1] = useState(false); - const [check2, setCheck2] = useState(false); - const [check3, setCheck3] = useState(false); - const [check4, setCheck4] = useState(false); + const [check1, setCheck1] = useState(false); + const [check2, setCheck2] = useState(false); + const [check3, setCheck3] = useState(false); + const [check4, setCheck4] = useState(false); - const [possible, setPossible] = useState(false); + const [possible, setPossible] = useState(false); const [alertOpen, setAlertOpen] = useState(false); useEffect(() => { From d053a60d10aecbdf033f9390c482f36e139b9f34 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Mon, 17 Jun 2024 23:21:12 +0900 Subject: [PATCH 02/24] =?UTF-8?q?feat:=20=ED=8C=8C=EC=9D=BC=EB=93=A4=20Boo?= =?UTF-8?q?lean=20=ED=83=80=EC=9E=85=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 --- components/AgreeBlock/index.tsx | 4 ++-- components/Carousel/index.tsx | 6 +++--- components/DeclarationModal/index.tsx | 6 +++--- components/Portal/index.tsx | 2 +- components/Setting/WithdrawBlock/index.tsx | 4 ++-- components/TabView/Tabs/index.tsx | 2 +- pages/agree/index.tsx | 6 +++--- pages/with-draw/index.tsx | 10 +++++----- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/components/AgreeBlock/index.tsx b/components/AgreeBlock/index.tsx index 99b8f7e3..3ddee3d2 100644 --- a/components/AgreeBlock/index.tsx +++ b/components/AgreeBlock/index.tsx @@ -9,8 +9,8 @@ import { Dispatch, SetStateAction, useEffect, useState } from 'react'; interface AgreeBlockProps { title: string; buttonClick?: () => void; - checked: Boolean; - setChecked: Dispatch>; + checked: boolean; + setChecked: Dispatch>; lastItem?: Boolean; } diff --git a/components/Carousel/index.tsx b/components/Carousel/index.tsx index f8d5341f..1c883e43 100644 --- a/components/Carousel/index.tsx +++ b/components/Carousel/index.tsx @@ -9,8 +9,8 @@ interface CarouselProps { ParentRef?: React.MutableRefObject; afterChange?: (currentIndex: number) => void; beforeChange?: (currentIndex: number, nextIndex: number) => void; - swipe?: Boolean; - dots?: Boolean; + swipe?: boolean; + dots?: boolean; initialSlide?: number; } @@ -26,7 +26,7 @@ export default function Carousel({ }: CarouselProps) { const sliderSettings = { speed: 400, - infinite: infinite as Boolean, //무한 슬라이드 true, + infinite: infinite as boolean, //무한 슬라이드 true, slidesToShow: slidesToShow, afterChange, beforeChange, diff --git a/components/DeclarationModal/index.tsx b/components/DeclarationModal/index.tsx index 07dbea36..c3652de6 100644 --- a/components/DeclarationModal/index.tsx +++ b/components/DeclarationModal/index.tsx @@ -30,7 +30,7 @@ export default function DeclarationModal({ setReceivedDeclaration, setReportStatus, }: DeclarationModalProps) { - const [checks, setChecks] = useState>([ + const [checks, setChecks] = useState>([ false, false, false, @@ -40,7 +40,7 @@ export default function DeclarationModal({ false, false, ]); - const [possible, setPossible] = useState(false); + const [possible, setPossible] = useState(false); useEffect(() => { setPossible(checks.some((check) => check)); @@ -63,7 +63,7 @@ export default function DeclarationModal({ const onClickDeclarationButton = async () => { const trueIndices: number[] = checks.reduce( - (acc: number[], currentValue: Boolean, currentIndex: number) => { + (acc: number[], currentValue: boolean, currentIndex: number) => { if (currentValue === true) { acc.push(currentIndex); } diff --git a/components/Portal/index.tsx b/components/Portal/index.tsx index 19c7bc05..74475817 100644 --- a/components/Portal/index.tsx +++ b/components/Portal/index.tsx @@ -2,7 +2,7 @@ import React, { ReactElement, useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; const Portal = ({ children }: { children: ReactElement }) => { - const [mounted, setMounted] = useState(false); + const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); diff --git a/components/Setting/WithdrawBlock/index.tsx b/components/Setting/WithdrawBlock/index.tsx index 103c4c2d..b73b2d2d 100644 --- a/components/Setting/WithdrawBlock/index.tsx +++ b/components/Setting/WithdrawBlock/index.tsx @@ -11,8 +11,8 @@ interface WithdrawBlockProps { content?: React.ReactNode; content2?: React.ReactNode; buttonClick?: () => void; - checked: Boolean; - setChecked: Dispatch>; + checked: boolean; + setChecked: Dispatch>; lastItem?: Boolean; } diff --git a/components/TabView/Tabs/index.tsx b/components/TabView/Tabs/index.tsx index 9ee8e199..3b1478c0 100644 --- a/components/TabView/Tabs/index.tsx +++ b/components/TabView/Tabs/index.tsx @@ -5,7 +5,7 @@ import Carousel from '@/components/Carousel'; interface TabsProps { children: React.ReactNode; - dots?: Boolean; + dots?: boolean; } export default function Tabs({ children, dots }: TabsProps) { diff --git a/pages/agree/index.tsx b/pages/agree/index.tsx index daa96e63..7e9b1aef 100644 --- a/pages/agree/index.tsx +++ b/pages/agree/index.tsx @@ -19,10 +19,10 @@ interface ComponentWithLayout extends FC { const Agree: ComponentWithLayout = () => { const router = useRouter(); - const [check1, setCheck1] = useState(false); - const [check2, setCheck2] = useState(false); + const [check1, setCheck1] = useState(false); + const [check2, setCheck2] = useState(false); - const [possible, setPossible] = useState(false); + const [possible, setPossible] = useState(false); const [alertOpen, setAlertOpen] = useState(false); useEffect(() => { diff --git a/pages/with-draw/index.tsx b/pages/with-draw/index.tsx index 26de23dd..bba9d69c 100644 --- a/pages/with-draw/index.tsx +++ b/pages/with-draw/index.tsx @@ -17,12 +17,12 @@ export default function Withdraw() { const router = useRouter(); - const [check1, setCheck1] = useState(false); - const [check2, setCheck2] = useState(false); - const [check3, setCheck3] = useState(false); - const [check4, setCheck4] = useState(false); + const [check1, setCheck1] = useState(false); + const [check2, setCheck2] = useState(false); + const [check3, setCheck3] = useState(false); + const [check4, setCheck4] = useState(false); - const [possible, setPossible] = useState(false); + const [possible, setPossible] = useState(false); const [alertOpen, setAlertOpen] = useState(false); useEffect(() => { From 9e73f8394d7e5d661d0fdcdb91c6922f1a5f9532 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Mon, 17 Jun 2024 23:38:16 +0900 Subject: [PATCH 03/24] =?UTF-8?q?feat:=20=ED=8C=8C=EC=9D=BC=EB=93=A4=20Boo?= =?UTF-8?q?lean=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/AgreeBlock/index.tsx | 4 ++-- components/Carousel/index.tsx | 6 +++--- components/DeclarationModal/index.tsx | 6 +++--- components/NextImage/index.tsx | 2 +- components/Portal/index.tsx | 2 +- components/Setting/WithdrawBlock/index.tsx | 4 ++-- components/TabView/Tabs/index.tsx | 2 +- pages/agree/index.tsx | 6 +++--- pages/with-draw/index.tsx | 10 +++++----- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/components/AgreeBlock/index.tsx b/components/AgreeBlock/index.tsx index 3ddee3d2..99b8f7e3 100644 --- a/components/AgreeBlock/index.tsx +++ b/components/AgreeBlock/index.tsx @@ -9,8 +9,8 @@ import { Dispatch, SetStateAction, useEffect, useState } from 'react'; interface AgreeBlockProps { title: string; buttonClick?: () => void; - checked: boolean; - setChecked: Dispatch>; + checked: Boolean; + setChecked: Dispatch>; lastItem?: Boolean; } diff --git a/components/Carousel/index.tsx b/components/Carousel/index.tsx index 1c883e43..f8d5341f 100644 --- a/components/Carousel/index.tsx +++ b/components/Carousel/index.tsx @@ -9,8 +9,8 @@ interface CarouselProps { ParentRef?: React.MutableRefObject; afterChange?: (currentIndex: number) => void; beforeChange?: (currentIndex: number, nextIndex: number) => void; - swipe?: boolean; - dots?: boolean; + swipe?: Boolean; + dots?: Boolean; initialSlide?: number; } @@ -26,7 +26,7 @@ export default function Carousel({ }: CarouselProps) { const sliderSettings = { speed: 400, - infinite: infinite as boolean, //무한 슬라이드 true, + infinite: infinite as Boolean, //무한 슬라이드 true, slidesToShow: slidesToShow, afterChange, beforeChange, diff --git a/components/DeclarationModal/index.tsx b/components/DeclarationModal/index.tsx index c3652de6..07dbea36 100644 --- a/components/DeclarationModal/index.tsx +++ b/components/DeclarationModal/index.tsx @@ -30,7 +30,7 @@ export default function DeclarationModal({ setReceivedDeclaration, setReportStatus, }: DeclarationModalProps) { - const [checks, setChecks] = useState>([ + const [checks, setChecks] = useState>([ false, false, false, @@ -40,7 +40,7 @@ export default function DeclarationModal({ false, false, ]); - const [possible, setPossible] = useState(false); + const [possible, setPossible] = useState(false); useEffect(() => { setPossible(checks.some((check) => check)); @@ -63,7 +63,7 @@ export default function DeclarationModal({ const onClickDeclarationButton = async () => { const trueIndices: number[] = checks.reduce( - (acc: number[], currentValue: boolean, currentIndex: number) => { + (acc: number[], currentValue: Boolean, currentIndex: number) => { if (currentValue === true) { acc.push(currentIndex); } diff --git a/components/NextImage/index.tsx b/components/NextImage/index.tsx index 5b946643..7fd7e779 100644 --- a/components/NextImage/index.tsx +++ b/components/NextImage/index.tsx @@ -3,7 +3,7 @@ import { MutableRefObject } from 'react'; interface ImageProps { src: string; alt: string; - fill: boolean; + fill: Boolean; className?: string; width?: number; height?: number; diff --git a/components/Portal/index.tsx b/components/Portal/index.tsx index 74475817..19c7bc05 100644 --- a/components/Portal/index.tsx +++ b/components/Portal/index.tsx @@ -2,7 +2,7 @@ import React, { ReactElement, useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; const Portal = ({ children }: { children: ReactElement }) => { - const [mounted, setMounted] = useState(false); + const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); diff --git a/components/Setting/WithdrawBlock/index.tsx b/components/Setting/WithdrawBlock/index.tsx index b73b2d2d..103c4c2d 100644 --- a/components/Setting/WithdrawBlock/index.tsx +++ b/components/Setting/WithdrawBlock/index.tsx @@ -11,8 +11,8 @@ interface WithdrawBlockProps { content?: React.ReactNode; content2?: React.ReactNode; buttonClick?: () => void; - checked: boolean; - setChecked: Dispatch>; + checked: Boolean; + setChecked: Dispatch>; lastItem?: Boolean; } diff --git a/components/TabView/Tabs/index.tsx b/components/TabView/Tabs/index.tsx index 3b1478c0..9ee8e199 100644 --- a/components/TabView/Tabs/index.tsx +++ b/components/TabView/Tabs/index.tsx @@ -5,7 +5,7 @@ import Carousel from '@/components/Carousel'; interface TabsProps { children: React.ReactNode; - dots?: boolean; + dots?: Boolean; } export default function Tabs({ children, dots }: TabsProps) { diff --git a/pages/agree/index.tsx b/pages/agree/index.tsx index 7e9b1aef..daa96e63 100644 --- a/pages/agree/index.tsx +++ b/pages/agree/index.tsx @@ -19,10 +19,10 @@ interface ComponentWithLayout extends FC { const Agree: ComponentWithLayout = () => { const router = useRouter(); - const [check1, setCheck1] = useState(false); - const [check2, setCheck2] = useState(false); + const [check1, setCheck1] = useState(false); + const [check2, setCheck2] = useState(false); - const [possible, setPossible] = useState(false); + const [possible, setPossible] = useState(false); const [alertOpen, setAlertOpen] = useState(false); useEffect(() => { diff --git a/pages/with-draw/index.tsx b/pages/with-draw/index.tsx index bba9d69c..26de23dd 100644 --- a/pages/with-draw/index.tsx +++ b/pages/with-draw/index.tsx @@ -17,12 +17,12 @@ export default function Withdraw() { const router = useRouter(); - const [check1, setCheck1] = useState(false); - const [check2, setCheck2] = useState(false); - const [check3, setCheck3] = useState(false); - const [check4, setCheck4] = useState(false); + const [check1, setCheck1] = useState(false); + const [check2, setCheck2] = useState(false); + const [check3, setCheck3] = useState(false); + const [check4, setCheck4] = useState(false); - const [possible, setPossible] = useState(false); + const [possible, setPossible] = useState(false); const [alertOpen, setAlertOpen] = useState(false); useEffect(() => { From 7069cbc3ca4b81eef9d03390d5f67e36c38cfd28 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Tue, 18 Jun 2024 00:21:43 +0900 Subject: [PATCH 04/24] =?UTF-8?q?feat:=20boolean=20=EC=B2=98=EB=A6=AC=20(#?= =?UTF-8?q?490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Carousel/index.tsx | 6 +++--- components/NextImage/index.tsx | 2 +- components/TabView/Tabs/index.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/Carousel/index.tsx b/components/Carousel/index.tsx index f8d5341f..9916f058 100644 --- a/components/Carousel/index.tsx +++ b/components/Carousel/index.tsx @@ -5,12 +5,12 @@ import Slider from 'react-slick'; interface CarouselProps { children: React.ReactNode; slidesToShow: number; - infinite: Boolean; + infinite: boolean; ParentRef?: React.MutableRefObject; afterChange?: (currentIndex: number) => void; beforeChange?: (currentIndex: number, nextIndex: number) => void; swipe?: Boolean; - dots?: Boolean; + dots?: boolean; initialSlide?: number; } @@ -26,7 +26,7 @@ export default function Carousel({ }: CarouselProps) { const sliderSettings = { speed: 400, - infinite: infinite as Boolean, //무한 슬라이드 true, + infinite: infinite as boolean, //무한 슬라이드 true, slidesToShow: slidesToShow, afterChange, beforeChange, diff --git a/components/NextImage/index.tsx b/components/NextImage/index.tsx index 7fd7e779..5b946643 100644 --- a/components/NextImage/index.tsx +++ b/components/NextImage/index.tsx @@ -3,7 +3,7 @@ import { MutableRefObject } from 'react'; interface ImageProps { src: string; alt: string; - fill: Boolean; + fill: boolean; className?: string; width?: number; height?: number; diff --git a/components/TabView/Tabs/index.tsx b/components/TabView/Tabs/index.tsx index 9ee8e199..3b1478c0 100644 --- a/components/TabView/Tabs/index.tsx +++ b/components/TabView/Tabs/index.tsx @@ -5,7 +5,7 @@ import Carousel from '@/components/Carousel'; interface TabsProps { children: React.ReactNode; - dots?: Boolean; + dots?: boolean; } export default function Tabs({ children, dots }: TabsProps) { From fa913fcfb1231c304006409ca58ea2e40e9457e8 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Tue, 18 Jun 2024 23:28:02 +0900 Subject: [PATCH 05/24] =?UTF-8?q?feat:=20number=20Number=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EC=9E=AC=20=EC=84=A4=EC=A0=95=20(#490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/FollowBlock/index.tsx | 2 +- components/PostingComment/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/FollowBlock/index.tsx b/components/FollowBlock/index.tsx index 3a99a0a6..d48010c5 100644 --- a/components/FollowBlock/index.tsx +++ b/components/FollowBlock/index.tsx @@ -5,7 +5,7 @@ import Button from '../Button'; interface FollowBlockProps { data: { - profileId: Number; + profileId: number; name: string; profileImage: string; followCheck?: Boolean; diff --git a/components/PostingComment/index.tsx b/components/PostingComment/index.tsx index 2d03b39f..612d15b1 100644 --- a/components/PostingComment/index.tsx +++ b/components/PostingComment/index.tsx @@ -67,7 +67,7 @@ function PostingComment({ if (commentType === 'all') setCommentType('preview'); }; const [data, setData] = useState([]); - const [totalCount, setTotalCount] = useState(0); + const [totalCount, setTotalCount] = useState(0); const { getOOTDComment } = OOTDApi(); From 0c65aab5730f9c3d1978c9246dceef7e3899228a Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Wed, 19 Jun 2024 00:41:52 +0900 Subject: [PATCH 06/24] =?UTF-8?q?feat:=20useState=20type=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Domain/MyPage/Closet/ClosetCloth/index.tsx | 2 +- components/Posting/index.tsx | 4 ++-- components/TabView/TabBar/index.tsx | 2 +- hooks/useDropDown.tsx | 4 ++-- hooks/useInfiniteScroll.tsx | 2 +- pages/add-cloth/index.tsx | 4 ++-- pages/add-ootd/ClothTag/index.tsx | 6 +++--- pages/add-ootd/index.tsx | 2 +- pages/cloth/[...ClothNumber].tsx | 2 +- pages/edit-cloth/[...ClothNumber].tsx | 6 +++--- pages/ootd/[...OOTDNumber].tsx | 4 ++-- pages/settings/index.tsx | 2 +- pages/sign-up/index.tsx | 8 ++++---- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx index becfefb0..acfb248b 100644 --- a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx +++ b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx @@ -50,7 +50,7 @@ export default function ClosetCloth({ showingId }: ClosetClothProps) { brand: null, isOpen: null, }); - const [searchResult, setSearchResult] = useState([]); + const [searchResult, setSearchResult] = useState([]); const [filterModalInitialIndex, setFilterModalInitialIndex] = useState(1); diff --git a/components/Posting/index.tsx b/components/Posting/index.tsx index c19878cb..840ef1f7 100644 --- a/components/Posting/index.tsx +++ b/components/Posting/index.tsx @@ -59,8 +59,8 @@ export default function Posting({ const [followState, setFollowState] = useState(false); const [heartState, setHeartState] = useState(false); const [bookMarkState, setBookMarkState] = useState(false); - const [componentWidth, setComponentWidth] = useState(0); //컴포넌트 길이 - const [componentHeight, setComponentHeight] = useState(0); //컴포넌트 높이 + const [componentWidth, setComponentWidth] = useState(0); //컴포넌트 길이 + const [componentHeight, setComponentHeight] = useState(0); //컴포넌트 높이 const [clothTagOpen, setClothTagOpen] = useState(true); const [reportModalIsOpen, setReportModalIsOpen] = useState(false); const [declaration, setDeclaration] = useState(false); // 신고 Modal diff --git a/components/TabView/TabBar/index.tsx b/components/TabView/TabBar/index.tsx index b7385ec5..4da7359f 100644 --- a/components/TabView/TabBar/index.tsx +++ b/components/TabView/TabBar/index.tsx @@ -23,7 +23,7 @@ export default function TabBar({ //props로 전달받은 tab의 개수만큼 유동적으로 초깃값 관리 const firstState = new Array(tab.length - 1).fill(false); - const [state, setState] = useState([true, ...firstState]); + const [state, setState] = useState>([true, ...firstState]); //처음엔 onChangeState가 일어나지 않게 하기 위한 상태 const [onChangeFirstState, setOnChangeFirstState] = useState(0); diff --git a/hooks/useDropDown.tsx b/hooks/useDropDown.tsx index fc3db910..1aa9a1f4 100644 --- a/hooks/useDropDown.tsx +++ b/hooks/useDropDown.tsx @@ -1,8 +1,8 @@ import { useState } from 'react'; const useDropdown = (initialValue: string) => { - const [value, setValue] = useState(initialValue); - const [state, setState] = useState(false); + const [value, setValue] = useState(initialValue); + const [state, setState] = useState(false); const onClickOption = (option: string) => { setValue(option); diff --git a/hooks/useInfiniteScroll.tsx b/hooks/useInfiniteScroll.tsx index 95cb7c1a..a90dea6a 100644 --- a/hooks/useInfiniteScroll.tsx +++ b/hooks/useInfiniteScroll.tsx @@ -18,7 +18,7 @@ export default function useInfiniteScroll({ key, }: InfiniteScrollProps) { const [page, setPage] = useState(initialPage ? initialPage : 0); - const [data, setData] = useState(initialData); + const [data, setData] = useState(initialData); const [hasNextPage, setHasNextPage] = useState(false); const [isLoading, setIsLoading] = useState(false); const [total, setTotal] = useState(0); // total 필드 추가 diff --git a/pages/add-cloth/index.tsx b/pages/add-cloth/index.tsx index d7f257fe..43005f8f 100644 --- a/pages/add-cloth/index.tsx +++ b/pages/add-cloth/index.tsx @@ -42,8 +42,8 @@ const AddCloth: ComponentWithLayout = () => { const [clothColor, setClothColor] = useState(null); const [clothSize, setClothSize] = useState(null); const [open, setOpen] = useState(true); - const [clothBuyDate, setClothBuyDate] = useState(''); - const [clothMemo, setClothMemo] = useState(''); + const [clothBuyDate, setClothBuyDate] = useState(''); + const [clothMemo, setClothMemo] = useState(''); const router = useRouter(); const myId = useRecoilValue(userId); diff --git a/pages/add-ootd/ClothTag/index.tsx b/pages/add-ootd/ClothTag/index.tsx index c2341993..3bad5c22 100644 --- a/pages/add-ootd/ClothTag/index.tsx +++ b/pages/add-ootd/ClothTag/index.tsx @@ -30,12 +30,12 @@ export default function ClothTag({ const dragRef = useRef(null); const imageRef = useRef(null); - const [componentWidth, setComponentWidth] = useState(0); //컴포넌트 길이 - const [componentHeight, setComponentHeight] = useState(0); //컴포넌트 높이 + const [componentWidth, setComponentWidth] = useState(0); //컴포넌트 길이 + const [componentHeight, setComponentHeight] = useState(0); //컴포넌트 높이 const [addTag, setAddTag] = useState(false); //옷 추가 모달 (열기/닫기) const [slideIndex, setSlideIndex] = useState(0); //OOTD 슬라이드 인덱스 const [nextButtonState, setNextButtonState] = useState(false); //다음 버튼 상태 - const [isDragging, setIsDragging] = useState(false); + const [isDragging, setIsDragging] = useState(false); //컴포넌트 크기 계산 useEffect(() => { diff --git a/pages/add-ootd/index.tsx b/pages/add-ootd/index.tsx index 8e0d93a2..0482cbcc 100644 --- a/pages/add-ootd/index.tsx +++ b/pages/add-ootd/index.tsx @@ -21,7 +21,7 @@ const AddOOTD: ComponentWithLayout = () => { const steps = ['편집', '태그', '게시하기']; const [Funnel, currentStep, handleStep] = useFunnel(steps); const [imageAndTag, setImageAndTag] = useState(); //이미지 + 태그 - const [string, setString] = useState(''); //게시글 + const [string, setString] = useState(''); //게시글 const [selectedStyle, setSelectedStyle] = useState([]); const [open, setOpen] = useState(true); //공개여부 const [complete, setComplete] = useState(false); //게시 완료 여부 diff --git a/pages/cloth/[...ClothNumber].tsx b/pages/cloth/[...ClothNumber].tsx index 93503b85..b955e7fd 100644 --- a/pages/cloth/[...ClothNumber].tsx +++ b/pages/cloth/[...ClothNumber].tsx @@ -46,7 +46,7 @@ export interface ClothDataType { const Cloth = () => { const router = useRouter(); const [data, setData] = useState(null); - const [reRender, setReRender] = useState(0); + const [reRender, setReRender] = useState(0); const { getClothDetail, deleteCloth, patchClothIsPrivate } = ClothApi(); const [reportModalIsOpen, setReportModalIsOpen] = useState(false); diff --git a/pages/edit-cloth/[...ClothNumber].tsx b/pages/edit-cloth/[...ClothNumber].tsx index e4aee89a..88e1de35 100644 --- a/pages/edit-cloth/[...ClothNumber].tsx +++ b/pages/edit-cloth/[...ClothNumber].tsx @@ -37,9 +37,9 @@ const EditCloth: ComponentWithLayout = () => { const [clothColor, setClothColor] = useState(null); const [clothSize, setClothSize] = useState(null); const [clothOpen, setClothOpen] = useState(true); - const [clothBuyDate, setClothBuyDate] = useState(''); - const [clothMemo, setClothMemo] = useState(''); - const [sizeRerender, setSizeRerender] = useState(0); + const [clothBuyDate, setClothBuyDate] = useState(''); + const [clothMemo, setClothMemo] = useState(''); + const [sizeRerender, setSizeRerender] = useState(0); const { getClothDetail, putCloth } = ClothApi(); diff --git a/pages/ootd/[...OOTDNumber].tsx b/pages/ootd/[...OOTDNumber].tsx index 1e257e32..0585014b 100644 --- a/pages/ootd/[...OOTDNumber].tsx +++ b/pages/ootd/[...OOTDNumber].tsx @@ -88,8 +88,8 @@ const OOTD: ComponentWithLayout = () => { const router = useRouter(); - const [reRender, setReRender] = useState(0); - const [getPostReRender, setGetPostReRender] = useState(0); + const [reRender, setReRender] = useState(0); + const [getPostReRender, setGetPostReRender] = useState(0); const onClickBackButton = () => { if (router.query.OOTDNumber![1] === 'explore') { diff --git a/pages/settings/index.tsx b/pages/settings/index.tsx index c84ad52c..f08c3f9e 100644 --- a/pages/settings/index.tsx +++ b/pages/settings/index.tsx @@ -18,7 +18,7 @@ export default function Setting() { const [queryState, setQueryState] = useState(false); const [URLState, setURLState] = useState(false); - const [platform, setPlatform] = useState(''); + const [platform, setPlatform] = useState(''); const { getSocilLoginProvider } = UserApi(); diff --git a/pages/sign-up/index.tsx b/pages/sign-up/index.tsx index c475884d..5171e5bb 100644 --- a/pages/sign-up/index.tsx +++ b/pages/sign-up/index.tsx @@ -20,10 +20,10 @@ interface ComponentWithLayout extends FC { const SignUp: ComponentWithLayout = () => { const steps = ['기본정보', '체형정보', '취향정보']; const [Funnel, currentStep, handleStep] = useFunnel(steps); - const [id, setId] = useState(''); - const [age, setAge] = useState(''); - const [height, setHeight] = useState(''); - const [weight, setWeight] = useState(''); + const [id, setId] = useState(''); + const [age, setAge] = useState(''); + const [height, setHeight] = useState(''); + const [weight, setWeight] = useState(''); const [open, setOpen] = useState(true); const [gender, setGender] = useState(true); const [canUseId, setCanUseId] = useState(false); From a634ef2e3d79352be392e062ec7f2186506eb586 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Sun, 23 Jun 2024 23:11:47 +0900 Subject: [PATCH 07/24] =?UTF-8?q?feat:=20ootdtypests=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=20(#490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/BrandList/Brand/index.tsx | 10 +++++----- components/Domain/AddCloth/BrandModal/index.tsx | 3 ++- utils/types/OOTD.types.ts | 5 +++++ utils/types/index.ts | 1 + 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 utils/types/OOTD.types.ts create mode 100644 utils/types/index.ts diff --git a/components/BrandList/Brand/index.tsx b/components/BrandList/Brand/index.tsx index 1ee85b56..3a6ba935 100644 --- a/components/BrandList/Brand/index.tsx +++ b/components/BrandList/Brand/index.tsx @@ -10,11 +10,11 @@ interface BrandProps { state?: Boolean; } -export interface BrandType { - id: number; - name: string; - state?: Boolean; -} +// export interface BrandType { +// id: number; +// name: string; +// state?: Boolean; +// } export default function Brand({ keyword, diff --git a/components/Domain/AddCloth/BrandModal/index.tsx b/components/Domain/AddCloth/BrandModal/index.tsx index d1d9bb39..fe1a67a8 100644 --- a/components/Domain/AddCloth/BrandModal/index.tsx +++ b/components/Domain/AddCloth/BrandModal/index.tsx @@ -3,7 +3,7 @@ import S from './style'; import { Body4, Button3, Title1 } from '@/components/UI'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import BrandList from '@/components/BrandList'; -import { BrandType } from '@/components/BrandList/Brand'; +// import { BrandType } from '@/components/BrandList/Brand'; import SearchBar from '@/components/SearchBar'; import { AiOutlineClose } from 'react-icons/ai'; import NextButton from '@/components/NextButton'; @@ -11,6 +11,7 @@ import ClothApi from '@/apis/domain/Cloth/ClothApi'; import CheckBoxTrue from '@/public/images/CheckBoxTrue.svg'; import CheckBoxFalse from '@/public/images/CheckBoxFalse.svg'; import Image from 'next/image'; +import { BrandType } from '@/utils/types/OOTD.types'; interface BrandModalProps { brandModalIsOpen: Boolean; diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts new file mode 100644 index 00000000..26b1a001 --- /dev/null +++ b/utils/types/OOTD.types.ts @@ -0,0 +1,5 @@ +export interface BrandType { + id: number; + name: string; + state?: Boolean; +} diff --git a/utils/types/index.ts b/utils/types/index.ts new file mode 100644 index 00000000..0251d4f3 --- /dev/null +++ b/utils/types/index.ts @@ -0,0 +1 @@ +export * as OOTDTypes from './OOTD.types'; From e4cb14bc333c7910556d6999f81b20ace27c0382 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Wed, 26 Jun 2024 21:52:01 +0900 Subject: [PATCH 08/24] =?UTF-8?q?feat:=20brandtype=20=EC=9E=AC=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20(#490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/BrandList/Brand/index.tsx | 6 ------ components/BrandList/index.tsx | 3 ++- components/Domain/AddCloth/BrandModal/index.tsx | 1 - components/Domain/MyPage/Closet/ClosetCloth/index.tsx | 2 +- components/Domain/MyPage/Closet/FilterModal/index.tsx | 2 +- pages/add-cloth/AdditionalInfo/index.tsx | 2 +- pages/add-cloth/BasicInfoFirst/index.tsx | 2 +- pages/add-cloth/BasicInfoSecond/index.tsx | 2 +- pages/add-cloth/index.tsx | 2 +- pages/edit-cloth/BasicInfo/index.tsx | 2 +- pages/edit-cloth/[...ClothNumber].tsx | 2 +- 11 files changed, 10 insertions(+), 16 deletions(-) diff --git a/components/BrandList/Brand/index.tsx b/components/BrandList/Brand/index.tsx index 3a6ba935..f17373ea 100644 --- a/components/BrandList/Brand/index.tsx +++ b/components/BrandList/Brand/index.tsx @@ -10,12 +10,6 @@ interface BrandProps { state?: Boolean; } -// export interface BrandType { -// id: number; -// name: string; -// state?: Boolean; -// } - export default function Brand({ keyword, name, diff --git a/components/BrandList/index.tsx b/components/BrandList/index.tsx index 527d18f8..bd408fc5 100644 --- a/components/BrandList/index.tsx +++ b/components/BrandList/index.tsx @@ -1,5 +1,6 @@ import { Dispatch, SetStateAction, useEffect } from 'react'; -import Brand, { BrandType } from './Brand'; +import Brand from './Brand'; +import { BrandType } from '@/utils/types/OOTD.types'; import S from './style'; import useEffectAfterMount from '@/hooks/useEffectAfterMount'; diff --git a/components/Domain/AddCloth/BrandModal/index.tsx b/components/Domain/AddCloth/BrandModal/index.tsx index fe1a67a8..b38c33a2 100644 --- a/components/Domain/AddCloth/BrandModal/index.tsx +++ b/components/Domain/AddCloth/BrandModal/index.tsx @@ -3,7 +3,6 @@ import S from './style'; import { Body4, Button3, Title1 } from '@/components/UI'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import BrandList from '@/components/BrandList'; -// import { BrandType } from '@/components/BrandList/Brand'; import SearchBar from '@/components/SearchBar'; import { AiOutlineClose } from 'react-icons/ai'; import NextButton from '@/components/NextButton'; diff --git a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx index acfb248b..c0c34632 100644 --- a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx +++ b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx @@ -7,7 +7,7 @@ import { AiOutlineDown } from 'react-icons/ai'; import FilterModal from '../FilterModal'; import { ColorListType } from '@/components/ColorList'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; -import { BrandType } from '@/components/BrandList/Brand'; +import { BrandType } from '@/utils/types/OOTD.types'; import useInfiniteScroll from '@/hooks/useInfiniteScroll'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; import Spinner from '@/components/Spinner'; diff --git a/components/Domain/MyPage/Closet/FilterModal/index.tsx b/components/Domain/MyPage/Closet/FilterModal/index.tsx index cfdd56cb..fcb7aac8 100644 --- a/components/Domain/MyPage/Closet/FilterModal/index.tsx +++ b/components/Domain/MyPage/Closet/FilterModal/index.tsx @@ -7,7 +7,7 @@ import ColorList, { ColorListType } from '@/components/ColorList'; import { Body4, Button3 } from '@/components/UI'; import { AiOutlineClose } from 'react-icons/ai'; import Button from '@/components/Button'; -import { BrandType } from '@/components/BrandList/Brand'; +import { BrandType } from '@/utils/types/OOTD.types'; import BrandList from '@/components/BrandList'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; import { MyPageApi } from '@/apis/domain/MyPage/MyPageApi'; diff --git a/pages/add-cloth/AdditionalInfo/index.tsx b/pages/add-cloth/AdditionalInfo/index.tsx index db2cf191..ac032db4 100644 --- a/pages/add-cloth/AdditionalInfo/index.tsx +++ b/pages/add-cloth/AdditionalInfo/index.tsx @@ -4,7 +4,7 @@ import { Dispatch, SetStateAction } from 'react'; import NextButton from '@/components/NextButton'; import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; -import { BrandType } from '@/components/BrandList/Brand'; +import { BrandType } from '@/utils/types/OOTD.types'; import S from '@/pageStyle/add-cloth/AdditionalInfo/style'; import NextImage from '@/components/NextImage'; diff --git a/pages/add-cloth/BasicInfoFirst/index.tsx b/pages/add-cloth/BasicInfoFirst/index.tsx index f9881343..6205cd6a 100644 --- a/pages/add-cloth/BasicInfoFirst/index.tsx +++ b/pages/add-cloth/BasicInfoFirst/index.tsx @@ -9,7 +9,7 @@ import ClothCategoryModal, { CategoryListType, } from '@/components/Domain/AddCloth/ClothCategoryModal'; import WhereToBuyModal from '@/components/Domain/AddCloth/WhereToBuyModal'; -import { BrandType } from '@/components/BrandList/Brand'; +import { BrandType } from '@/utils/types/OOTD.types'; import BrandModal from '@/components/Domain/AddCloth/BrandModal'; import NextImage from '@/components/NextImage'; import ArrowLeft from '@/public/images/ArrowLeft.svg'; diff --git a/pages/add-cloth/BasicInfoSecond/index.tsx b/pages/add-cloth/BasicInfoSecond/index.tsx index 290fb79f..d0a3e3df 100644 --- a/pages/add-cloth/BasicInfoSecond/index.tsx +++ b/pages/add-cloth/BasicInfoSecond/index.tsx @@ -13,7 +13,7 @@ import ClothSizeModal, { SizeItem, } from '@/components/Domain/AddCloth/ClothSizeModal'; import AddClothAlert from '@/components/Domain/AddCloth/AddClothAlert'; -import { BrandType } from '@/components/BrandList/Brand'; +import { BrandType } from '@/utils/types/OOTD.types'; import { ClothWhereBuy } from '..'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; import { useRouter } from 'next/router'; diff --git a/pages/add-cloth/index.tsx b/pages/add-cloth/index.tsx index 43005f8f..ff15aefe 100644 --- a/pages/add-cloth/index.tsx +++ b/pages/add-cloth/index.tsx @@ -16,7 +16,7 @@ import { useRouter } from 'next/router'; import ClothName from './ClothName'; import { SizeItem } from '@/components/Domain/AddCloth/ClothSizeModal'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; -import { BrandType } from '@/components/BrandList/Brand'; +import { BrandType } from '@/utils/types/OOTD.types'; import { useRecoilValue } from 'recoil'; import { userId } from '@/utils/recoil/atom'; import useRememberScroll from '@/hooks/useRememberScroll'; diff --git a/pages/edit-cloth/BasicInfo/index.tsx b/pages/edit-cloth/BasicInfo/index.tsx index e19a3e1d..84a30a13 100644 --- a/pages/edit-cloth/BasicInfo/index.tsx +++ b/pages/edit-cloth/BasicInfo/index.tsx @@ -8,7 +8,7 @@ import ClothCategoryModal, { CategoryListType, } from '@/components/Domain/AddCloth/ClothCategoryModal'; import WhereToBuyModal from '@/components/Domain/AddCloth/WhereToBuyModal'; -import { BrandType } from '@/components/BrandList/Brand'; +import { BrandType } from '@/utils/types/OOTD.types'; import BrandModal from '@/components/Domain/AddCloth/BrandModal'; import { ColorListType } from '@/components/ColorList'; import ClothSizeModal, { diff --git a/pages/edit-cloth/[...ClothNumber].tsx b/pages/edit-cloth/[...ClothNumber].tsx index 88e1de35..74da0ddf 100644 --- a/pages/edit-cloth/[...ClothNumber].tsx +++ b/pages/edit-cloth/[...ClothNumber].tsx @@ -9,7 +9,7 @@ import { useRouter } from 'next/router'; import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; import { ColorListType } from '@/components/ColorList'; -import { BrandType } from '@/components/BrandList/Brand'; +import { BrandType } from '@/utils/types/OOTD.types'; import { SizeItem } from '@/components/Domain/AddCloth/ClothSizeModal'; import BasicInfo from './BasicInfo'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; From 22e4af7b42f803445da440edf7118f2943a97233 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Wed, 26 Jun 2024 21:54:57 +0900 Subject: [PATCH 09/24] =?UTF-8?q?feat:=20colorlisttype=20=EC=9E=AC?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20(#490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ColorList/index.tsx | 8 +------- components/Domain/AddCloth/ColorModal/index.tsx | 3 ++- components/Domain/MyPage/Closet/ClosetCloth/index.tsx | 2 +- components/Domain/MyPage/Closet/FilterModal/index.tsx | 4 +++- pages/add-cloth/BasicInfoSecond/index.tsx | 2 +- pages/add-cloth/index.tsx | 2 +- pages/edit-cloth/BasicInfo/index.tsx | 2 +- pages/edit-cloth/[...ClothNumber].tsx | 7 +------ utils/types/OOTD.types.ts | 7 +++++++ 9 files changed, 18 insertions(+), 19 deletions(-) diff --git a/components/ColorList/index.tsx b/components/ColorList/index.tsx index 29982e70..6f8f45e2 100644 --- a/components/ColorList/index.tsx +++ b/components/ColorList/index.tsx @@ -2,13 +2,7 @@ import { Dispatch, SetStateAction, useEffect, useLayoutEffect } from 'react'; import S from './style'; import ColorSpan from './ColorSpan'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; - -export type ColorListType = { - id: number; - name: string; - colorCode: string; - state: Boolean; -}[]; +import { ColorListType } from '@/utils/types/OOTD.types'; interface ColorListProps { colorList: ColorListType; diff --git a/components/Domain/AddCloth/ColorModal/index.tsx b/components/Domain/AddCloth/ColorModal/index.tsx index f985b209..79f6b889 100644 --- a/components/Domain/AddCloth/ColorModal/index.tsx +++ b/components/Domain/AddCloth/ColorModal/index.tsx @@ -5,8 +5,9 @@ import NextButton from '@/components/NextButton'; import { AiOutlineClose } from 'react-icons/ai'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import React from 'react'; -import ColorList, { ColorListType } from '@/components/ColorList'; +import ColorList from '@/components/ColorList'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; +import { ColorListType } from '@/utils/types/OOTD.types'; interface ColorModalProps { isOpen: Boolean; setIsOpen: Dispatch>; diff --git a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx index c0c34632..659a809d 100644 --- a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx +++ b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx @@ -5,7 +5,6 @@ import ImageList from '@/components/ImageList'; import { useRouter } from 'next/router'; import { AiOutlineDown } from 'react-icons/ai'; import FilterModal from '../FilterModal'; -import { ColorListType } from '@/components/ColorList'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; import { BrandType } from '@/utils/types/OOTD.types'; import useInfiniteScroll from '@/hooks/useInfiniteScroll'; @@ -17,6 +16,7 @@ import { ClothDataType } from '@/pages/cloth/[...ClothNumber]'; import Background from '@/components/Background'; import useRememberScroll from '@/hooks/useRememberScroll'; import useEffectAfterMount from '@/hooks/useEffectAfterMount'; +import { ColorListType } from '@/utils/types/OOTD.types'; interface ClosetClothProps { showingId: number; diff --git a/components/Domain/MyPage/Closet/FilterModal/index.tsx b/components/Domain/MyPage/Closet/FilterModal/index.tsx index fcb7aac8..adffc2bc 100644 --- a/components/Domain/MyPage/Closet/FilterModal/index.tsx +++ b/components/Domain/MyPage/Closet/FilterModal/index.tsx @@ -3,7 +3,7 @@ import S from './style'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import TabView from '@/components/TabView'; import ClothCategory from '@/components/ClothCategory'; -import ColorList, { ColorListType } from '@/components/ColorList'; +import ColorList from '@/components/ColorList'; import { Body4, Button3 } from '@/components/UI'; import { AiOutlineClose } from 'react-icons/ai'; import Button from '@/components/Button'; @@ -18,6 +18,8 @@ import { SearchFilterData, } from '@/components/Domain/Search/SearchResult/ClosetCloth'; +import { ColorListType } from '@/utils/types/OOTD.types'; + interface FilterModalProps { isOpen: Boolean; setFilterModalIsOpen: Dispatch>; diff --git a/pages/add-cloth/BasicInfoSecond/index.tsx b/pages/add-cloth/BasicInfoSecond/index.tsx index d0a3e3df..9c5b1c1e 100644 --- a/pages/add-cloth/BasicInfoSecond/index.tsx +++ b/pages/add-cloth/BasicInfoSecond/index.tsx @@ -4,7 +4,7 @@ import { Dispatch, SetStateAction, useState } from 'react'; import Input from '@/components/Input'; import NextButton from '@/components/NextButton'; import PlusButton from '@/components/PlusButton'; -import { ColorListType } from '@/components/ColorList'; +import { ColorListType } from '@/utils/types/OOTD.types'; import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; import ColorSpan from '@/components/ColorList/ColorSpan'; diff --git a/pages/add-cloth/index.tsx b/pages/add-cloth/index.tsx index ff15aefe..59a44cae 100644 --- a/pages/add-cloth/index.tsx +++ b/pages/add-cloth/index.tsx @@ -11,7 +11,7 @@ import BasicInfoSecond from './BasicInfoSecond'; import AdditionalInfo from './AdditionalInfo'; import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; -import { ColorListType } from '@/components/ColorList'; +import { ColorListType } from '@/utils/types/OOTD.types'; import { useRouter } from 'next/router'; import ClothName from './ClothName'; import { SizeItem } from '@/components/Domain/AddCloth/ClothSizeModal'; diff --git a/pages/edit-cloth/BasicInfo/index.tsx b/pages/edit-cloth/BasicInfo/index.tsx index 84a30a13..0a47e266 100644 --- a/pages/edit-cloth/BasicInfo/index.tsx +++ b/pages/edit-cloth/BasicInfo/index.tsx @@ -10,7 +10,7 @@ import ClothCategoryModal, { import WhereToBuyModal from '@/components/Domain/AddCloth/WhereToBuyModal'; import { BrandType } from '@/utils/types/OOTD.types'; import BrandModal from '@/components/Domain/AddCloth/BrandModal'; -import { ColorListType } from '@/components/ColorList'; +import { ColorListType } from '@/utils/types/OOTD.types'; import ClothSizeModal, { SizeItem, } from '@/components/Domain/AddCloth/ClothSizeModal'; diff --git a/pages/edit-cloth/[...ClothNumber].tsx b/pages/edit-cloth/[...ClothNumber].tsx index 74da0ddf..406a2f39 100644 --- a/pages/edit-cloth/[...ClothNumber].tsx +++ b/pages/edit-cloth/[...ClothNumber].tsx @@ -8,17 +8,12 @@ import { AppLayoutProps } from '@/AppLayout'; import { useRouter } from 'next/router'; import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; -import { ColorListType } from '@/components/ColorList'; +import { ColorListType } from '@/utils/types/OOTD.types'; import { BrandType } from '@/utils/types/OOTD.types'; import { SizeItem } from '@/components/Domain/AddCloth/ClothSizeModal'; import BasicInfo from './BasicInfo'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; -export interface ClothWhereBuy { - letter: string; - type: 'Link' | 'Write'; -} - const EditCloth: ComponentWithLayout = () => { const router = useRouter(); const steps = ['기본정보', '추가정보']; diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index 26b1a001..b8749ed2 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -3,3 +3,10 @@ export interface BrandType { name: string; state?: Boolean; } + +export type ColorListType = { + id: number; + name: string; + colorCode: string; + state: Boolean; +}[]; From ee848166aa824e31d04e10f2f190918754b70adf Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Wed, 26 Jun 2024 22:25:01 +0900 Subject: [PATCH 10/24] =?UTF-8?q?feat:=20clothwheretype=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20(#490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Domain/AddCloth/WhereToBuyModal/index.tsx | 2 +- pages/add-cloth/BasicInfoFirst/index.tsx | 2 +- pages/add-cloth/BasicInfoSecond/index.tsx | 2 +- pages/add-cloth/index.tsx | 6 +----- pages/edit-cloth/BasicInfo/index.tsx | 2 +- pages/edit-cloth/[...ClothNumber].tsx | 1 + utils/types/OOTD.types.ts | 5 +++++ 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/components/Domain/AddCloth/WhereToBuyModal/index.tsx b/components/Domain/AddCloth/WhereToBuyModal/index.tsx index b90c7c7d..3f796b19 100644 --- a/components/Domain/AddCloth/WhereToBuyModal/index.tsx +++ b/components/Domain/AddCloth/WhereToBuyModal/index.tsx @@ -4,7 +4,7 @@ import Input from '@/components/Input'; import { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react'; import Modal from '@/components/Modal'; import NextButton from '@/components/NextButton'; -import { ClothWhereBuy } from '@/pages/add-cloth'; +import { ClothWhereBuy } from '@/utils/types/OOTD.types'; import { AiOutlineClose } from 'react-icons/ai'; interface WhereToBuyModal { diff --git a/pages/add-cloth/BasicInfoFirst/index.tsx b/pages/add-cloth/BasicInfoFirst/index.tsx index 6205cd6a..091cdc27 100644 --- a/pages/add-cloth/BasicInfoFirst/index.tsx +++ b/pages/add-cloth/BasicInfoFirst/index.tsx @@ -3,7 +3,7 @@ import { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react'; import Input from '@/components/Input'; import { Body2, Body3, Title1 } from '@/components/UI'; import NextButton from '@/components/NextButton'; -import { ClothWhereBuy } from '..'; +import { ClothWhereBuy } from '@/utils/types/OOTD.types'; import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; import ClothCategoryModal, { CategoryListType, diff --git a/pages/add-cloth/BasicInfoSecond/index.tsx b/pages/add-cloth/BasicInfoSecond/index.tsx index 9c5b1c1e..8a53f638 100644 --- a/pages/add-cloth/BasicInfoSecond/index.tsx +++ b/pages/add-cloth/BasicInfoSecond/index.tsx @@ -14,7 +14,7 @@ import ClothSizeModal, { } from '@/components/Domain/AddCloth/ClothSizeModal'; import AddClothAlert from '@/components/Domain/AddCloth/AddClothAlert'; import { BrandType } from '@/utils/types/OOTD.types'; -import { ClothWhereBuy } from '..'; +import { ClothWhereBuy } from '@/utils/types/OOTD.types'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; import { useRouter } from 'next/router'; import { useRecoilValue } from 'recoil'; diff --git a/pages/add-cloth/index.tsx b/pages/add-cloth/index.tsx index 59a44cae..b64d0572 100644 --- a/pages/add-cloth/index.tsx +++ b/pages/add-cloth/index.tsx @@ -20,11 +20,7 @@ import { BrandType } from '@/utils/types/OOTD.types'; import { useRecoilValue } from 'recoil'; import { userId } from '@/utils/recoil/atom'; import useRememberScroll from '@/hooks/useRememberScroll'; - -export interface ClothWhereBuy { - letter: string; - type: 'Link' | 'Write'; -} +import { ClothWhereBuy } from '@/utils/types/OOTD.types'; const AddCloth: ComponentWithLayout = () => { const steps = ['편집', '제품명', '기본정보1', '기본정보2', '추가정보']; diff --git a/pages/edit-cloth/BasicInfo/index.tsx b/pages/edit-cloth/BasicInfo/index.tsx index 0a47e266..98d9cfe7 100644 --- a/pages/edit-cloth/BasicInfo/index.tsx +++ b/pages/edit-cloth/BasicInfo/index.tsx @@ -2,7 +2,7 @@ import S from '@/pageStyle/edit-cloth/BasicInfo/style'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import Input from '@/components/Input'; import { Body3, Title1 } from '@/components/UI'; -import { ClothWhereBuy } from '../[...ClothNumber]'; +import { ClothWhereBuy } from '@/utils/types/OOTD.types'; import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; import ClothCategoryModal, { CategoryListType, diff --git a/pages/edit-cloth/[...ClothNumber].tsx b/pages/edit-cloth/[...ClothNumber].tsx index 406a2f39..274ca6ed 100644 --- a/pages/edit-cloth/[...ClothNumber].tsx +++ b/pages/edit-cloth/[...ClothNumber].tsx @@ -13,6 +13,7 @@ import { BrandType } from '@/utils/types/OOTD.types'; import { SizeItem } from '@/components/Domain/AddCloth/ClothSizeModal'; import BasicInfo from './BasicInfo'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; +import { ClothWhereBuy } from '@/utils/types/OOTD.types'; const EditCloth: ComponentWithLayout = () => { const router = useRouter(); diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index b8749ed2..8331c187 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -10,3 +10,8 @@ export type ColorListType = { colorCode: string; state: Boolean; }[]; + +export interface ClothWhereBuy { + letter: string; + type: 'Link' | 'Write'; +} From 2695569e223e9238957ea044ab47a0b376794845 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Thu, 27 Jun 2024 23:44:55 +0900 Subject: [PATCH 11/24] feat: usertype (#490) --- utils/types/user.types.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 utils/types/user.types.ts diff --git a/utils/types/user.types.ts b/utils/types/user.types.ts new file mode 100644 index 00000000..20698ce7 --- /dev/null +++ b/utils/types/user.types.ts @@ -0,0 +1,14 @@ +export interface UserProfileDataType { + userId: number; + userName: string; + profileImage: string; + followerCount: number; + followingCount: number; + height: number; + weight: number; + description: string; + isMyProfile: Boolean; + isFollow: Boolean; + ootdCount: number; + clothesCount: number; +} From 421bd9db0f56c7b61dffc83a9ad5b4778ef49ada Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Fri, 28 Jun 2024 02:31:55 +0900 Subject: [PATCH 12/24] =?UTF-8?q?feat:=20userprofiletype=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20(#490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Domain/MyPage/Profile/index.tsx | 16 +--------------- pages/mypage/[...UserId].tsx | 2 +- utils/types/index.ts | 1 + 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/components/Domain/MyPage/Profile/index.tsx b/components/Domain/MyPage/Profile/index.tsx index 71e44773..13751480 100644 --- a/components/Domain/MyPage/Profile/index.tsx +++ b/components/Domain/MyPage/Profile/index.tsx @@ -3,21 +3,7 @@ import S from './style'; import Button from '@/components/Button'; import { Body3, Body4, Button3 } from '@/components/UI'; import { useRouter } from 'next/router'; - -export interface UserProfileDataType { - userId: number; - userName: string; - profileImage: string; - followerCount: number; - followingCount: number; - height: number; - weight: number; - description: string; - isMyProfile: Boolean; - isFollow: Boolean; - ootdCount: number; - clothesCount: number; -} +import { UserProfileDataType } from '@/utils/types/user.types'; interface profileProps { data: UserProfileDataType; diff --git a/pages/mypage/[...UserId].tsx b/pages/mypage/[...UserId].tsx index a339e545..ff1daa73 100644 --- a/pages/mypage/[...UserId].tsx +++ b/pages/mypage/[...UserId].tsx @@ -11,7 +11,7 @@ import Closet from '@/components/Domain/MyPage/Closet'; import { useState, useEffect, useRef, useCallback } from 'react'; import Toast from '@/components/Toast'; import { UserApi } from '@/apis/domain/User/UserApi'; -import { UserProfileDataType } from '@/components/Domain/MyPage/Profile'; +import { UserProfileDataType } from '@/utils/types/user.types'; import OtherModal from '@/components/Domain/MyPage/OtherModal'; import Background from '@/components/Background'; import PublicApi from '@/apis/domain/Public/PublicApi'; diff --git a/utils/types/index.ts b/utils/types/index.ts index 0251d4f3..d7b98f28 100644 --- a/utils/types/index.ts +++ b/utils/types/index.ts @@ -1 +1,2 @@ export * as OOTDTypes from './OOTD.types'; +export * as userTypes from './user.types'; From 601262952a93ae4b072e5fb4137613d2fd6f5592 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Fri, 28 Jun 2024 03:45:02 +0900 Subject: [PATCH 13/24] =?UTF-8?q?feat:=20type=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Domain/Main/Explore/index.tsx | 2 +- .../Domain/OOTD/UserOtherOOTD/index.tsx | 8 +- .../Search/SearchResult/ClosetCloth/index.tsx | 12 +-- .../Domain/Search/SearchResult/index.tsx | 3 +- components/Posting/index.tsx | 2 +- .../PostingCommentWrite/index.tsx | 2 +- components/PostingComment/index.tsx | 2 +- pages/ootd/[...OOTDNumber].tsx | 67 +--------------- utils/types/OOTD.types.ts | 77 +++++++++++++++++++ 9 files changed, 87 insertions(+), 88 deletions(-) diff --git a/components/Domain/Main/Explore/index.tsx b/components/Domain/Main/Explore/index.tsx index b551298c..26e11d69 100644 --- a/components/Domain/Main/Explore/index.tsx +++ b/components/Domain/Main/Explore/index.tsx @@ -3,7 +3,7 @@ import { useState } from 'react'; import { useRouter } from 'next/router'; import useInfiniteScroll from '@/hooks/useInfiniteScroll'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; -import { OOTDListType } from '../../Search/SearchResult/ClosetCloth'; +import { OOTDListType } from '@/utils/types/OOTD.types'; import useEffectAfterMount from '@/hooks/useEffectAfterMount'; import SubHead from '../../Search/SearchResult/SubHead'; import ImageList from '@/components/ImageList'; diff --git a/components/Domain/OOTD/UserOtherOOTD/index.tsx b/components/Domain/OOTD/UserOtherOOTD/index.tsx index 20c7e8d5..5f7fa50a 100644 --- a/components/Domain/OOTD/UserOtherOOTD/index.tsx +++ b/components/Domain/OOTD/UserOtherOOTD/index.tsx @@ -6,17 +6,13 @@ import { useEffect } from 'react'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; import Carousel from '@/components/Carousel'; import NextImage from '@/components/NextImage'; +import { OOTDListType } from '@/utils/types/OOTD.types'; interface UserOOTDProps { userId?: number; userName?: string; } -interface OOTDListType { - id: number; - image: string; -} - export default function UserOtherOOTD({ userId, userName }: UserOOTDProps) { const router = useRouter(); const { otherOOTD } = OOTDApi(); @@ -50,7 +46,7 @@ export default function UserOtherOOTD({ userId, userName }: UserOOTDProps) { router.push(`/ootd/${item.id}`)} key={item.id} - src={item.image} + src={item.imageUrl} alt="이 유저의 다른 ootd" fill={false} width={167} diff --git a/components/Domain/Search/SearchResult/ClosetCloth/index.tsx b/components/Domain/Search/SearchResult/ClosetCloth/index.tsx index 2a8f678a..755f92fd 100644 --- a/components/Domain/Search/SearchResult/ClosetCloth/index.tsx +++ b/components/Domain/Search/SearchResult/ClosetCloth/index.tsx @@ -12,6 +12,7 @@ import Portal from '@/components/Portal'; import EmptyFilteredResult from '../EmptyFilteredResult'; import Background from '@/components/Background'; import useRememberScroll from '@/hooks/useRememberScroll'; +import { OOTDListType, GenderTypes } from '@/utils/types/OOTD.types'; interface ClosetClothProps { OOTDTotal: number; @@ -26,17 +27,6 @@ interface ClosetClothProps { setSortStandard: Dispatch>; } -export type OOTDListType = { - id: number; - imageUrl: string; - imageCount: number; -}; - -export type GenderTypes = { - man: Boolean; - woman: Boolean; -}; - export interface SearchFilterData extends FilterData { gender?: GenderTypes; } diff --git a/components/Domain/Search/SearchResult/index.tsx b/components/Domain/Search/SearchResult/index.tsx index c53801e7..cafc2594 100644 --- a/components/Domain/Search/SearchResult/index.tsx +++ b/components/Domain/Search/SearchResult/index.tsx @@ -1,5 +1,5 @@ import S from './style'; -import ClosetCloth, { OOTDListType } from './ClosetCloth'; +import ClosetCloth from './ClosetCloth'; import Profile, { ProfileListType } from './Profile'; import EmptySearch from '@/components/EmptySearch'; import { UserApi } from '@/apis/domain/User/UserApi'; @@ -11,6 +11,7 @@ import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; import TabView from '@/components/TabView'; import { FilterData } from '../../MyPage/Closet/ClosetCloth'; import useRememberScroll from '@/hooks/useRememberScroll'; +import { OOTDListType } from '@/utils/types/OOTD.types'; interface searchResultProps { keywordsValue: string; diff --git a/components/Posting/index.tsx b/components/Posting/index.tsx index 840ef1f7..4b6a99bb 100644 --- a/components/Posting/index.tsx +++ b/components/Posting/index.tsx @@ -32,7 +32,7 @@ import Avatar from '@/public/images/Avatar.svg'; import Toast from '../Toast'; import FixModal from '../Domain/OOTD/FixModal'; import LikeToggle from '../Toggle/LikeToggle'; -import { OOTDType } from '@/pages/ootd/[...OOTDNumber]'; +import { OOTDType } from '@/utils/types/OOTD.types'; import Image from '../NextImage'; import NextImage from '../NextImage'; import Background from '../Background'; diff --git a/components/PostingComment/PostingCommentWrite/index.tsx b/components/PostingComment/PostingCommentWrite/index.tsx index 59a7e534..4c7e29b2 100644 --- a/components/PostingComment/PostingCommentWrite/index.tsx +++ b/components/PostingComment/PostingCommentWrite/index.tsx @@ -7,7 +7,7 @@ import { useEffect, useState, } from 'react'; -import { CommentStateType } from '@/pages/ootd/[...OOTDNumber]'; +import { CommentStateType } from '@/utils/types/OOTD.types'; import { AiFillCloseCircle } from 'react-icons/ai'; import Avatar from '@/public/images/Avatar.svg'; import NextImage from '@/components/NextImage'; diff --git a/components/PostingComment/index.tsx b/components/PostingComment/index.tsx index 612d15b1..62924f0b 100644 --- a/components/PostingComment/index.tsx +++ b/components/PostingComment/index.tsx @@ -9,7 +9,7 @@ import React, { import S from './style'; import Comment, { CommentProps } from '../Comment'; import { Body4, Caption1, Title1 } from '../UI'; -import { CommentStateType } from '@/pages/ootd/[...OOTDNumber]'; +import { CommentStateType } from '@/utils/types/OOTD.types'; import { useRecoilValue } from 'recoil'; import { userId } from '@/utils/recoil/atom'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; diff --git a/pages/ootd/[...OOTDNumber].tsx b/pages/ootd/[...OOTDNumber].tsx index 0585014b..2f86e778 100644 --- a/pages/ootd/[...OOTDNumber].tsx +++ b/pages/ootd/[...OOTDNumber].tsx @@ -16,72 +16,7 @@ import Toast from '@/components/Toast'; import AppBar from '@/components/Appbar'; import { AiOutlineArrowLeft } from 'react-icons/ai'; import Background from '@/components/Background'; - -export interface CommentStateType { - ootdId: number; - parentDepth: number; - content: string; - taggedUserName?: string; - commentParentId?: number; -} - -export interface OOTDType { - id: number; - contents: string; //본문 - viewCount: number; //조회수 - reportCount: number; //신고 횟수 - likeCount: number; //좋아요 개수 - userName: string; //유저명 - userImage: string; //유저 프로필 이미지 - userId: number; - createAt: string; //작성일 - isBookmark: Boolean; - isLike: Boolean; - isPrivate: Boolean; - isFollowing: Boolean; - ootdImages: { - ootdImage: string; //ootd 이미지 - ootdImageClothesList?: { - clothesId: number; - clothesImage: string; - brand: { id: number; name: string }; //옷 브랜드 - category: { - id: number; - smallCategory: string; - bigCategory: string; - }; - size: string; - clothesName: string; //옷 별칭 - coordinate: { - xrate: string; - yrate: string; - }; - deviceSize: { - deviceWidth: number; - deviceHeight: number; - }; - }[]; - }[]; - styles: { - styleId: number; - name: string; - }[]; - comment?: { - id: number; - userName: string; - userImage: string; - content: string; - timeStamp: string; - childComment?: { - id: number; - userName: string; - userImage: string; - content: string; - createAt: string; - taggedUserName: string; - }[]; - }[]; -} +import { CommentStateType, OOTDType } from '@/utils/types/OOTD.types'; const OOTD: ComponentWithLayout = () => { const { getOOTDDetail, postOOTDComment } = OOTDApi(); diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index 8331c187..ad47d296 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -15,3 +15,80 @@ export interface ClothWhereBuy { letter: string; type: 'Link' | 'Write'; } + +export interface CommentStateType { + ootdId: number; + parentDepth: number; + content: string; + taggedUserName?: string; + commentParentId?: number; +} + +export interface OOTDType { + id: number; + contents: string; //본문 + viewCount: number; //조회수 + reportCount: number; //신고 횟수 + likeCount: number; //좋아요 개수 + userName: string; //유저명 + userImage: string; //유저 프로필 이미지 + userId: number; + createAt: string; //작성일 + isBookmark: Boolean; + isLike: Boolean; + isPrivate: Boolean; + isFollowing: Boolean; + ootdImages: { + ootdImage: string; //ootd 이미지 + ootdImageClothesList?: { + clothesId: number; + clothesImage: string; + brand: { id: number; name: string }; //옷 브랜드 + category: { + id: number; + smallCategory: string; + bigCategory: string; + }; + size: string; + clothesName: string; //옷 별칭 + coordinate: { + xrate: string; + yrate: string; + }; + deviceSize: { + deviceWidth: number; + deviceHeight: number; + }; + }[]; + }[]; + styles: { + styleId: number; + name: string; + }[]; + comment?: { + id: number; + userName: string; + userImage: string; + content: string; + timeStamp: string; + childComment?: { + id: number; + userName: string; + userImage: string; + content: string; + createAt: string; + taggedUserName: string; + }[]; + }[]; +} + +export type OOTDListType = { + id: number; + imageUrl: string; + imageCount?: number; +}; + +export type GenderTypes = { + man: Boolean; + woman: Boolean; +}; From ac77045a484f0f45b6363d6d3549894b841ea8a3 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Mon, 1 Jul 2024 23:19:46 +0900 Subject: [PATCH 14/24] feat: imagewithtag export (#450) --- .../AddOOTD/TagModal/NewRegister/index.tsx | 2 +- components/Domain/AddOOTD/TagModal/index.tsx | 18 +----------------- components/Gallery/index.tsx | 2 +- pages/add-cloth/AdditionalInfo/index.tsx | 2 +- pages/add-cloth/BasicInfoFirst/index.tsx | 2 +- pages/add-cloth/BasicInfoSecond/index.tsx | 2 +- pages/add-cloth/ClothName/index.tsx | 2 +- pages/add-cloth/index.tsx | 2 +- pages/add-ootd/ClothTag/index.tsx | 3 ++- pages/add-ootd/WriteOOTD/index.tsx | 2 +- pages/add-ootd/index.tsx | 2 +- pages/edit-cloth/AdditionalInfo/index.tsx | 2 +- pages/edit-cloth/BasicInfo/index.tsx | 2 +- pages/edit-cloth/[...ClothNumber].tsx | 2 +- pages/edit-ootd/[...OOTDNumber].tsx | 2 +- utils/reactNativeMessage.ts | 2 +- utils/types/OOTD.types.ts | 17 +++++++++++++++++ 17 files changed, 34 insertions(+), 32 deletions(-) diff --git a/components/Domain/AddOOTD/TagModal/NewRegister/index.tsx b/components/Domain/AddOOTD/TagModal/NewRegister/index.tsx index e5dc5099..de16cb6f 100644 --- a/components/Domain/AddOOTD/TagModal/NewRegister/index.tsx +++ b/components/Domain/AddOOTD/TagModal/NewRegister/index.tsx @@ -1,7 +1,7 @@ import { Body3, Button3, Headline2 } from '@/components/UI'; import S from './style'; import { useRouter } from 'next/router'; -import { ImageWithTag } from '..'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import { useSetRecoilState } from 'recoil'; import { storedImageKey } from '@/utils/recoil/atom'; diff --git a/components/Domain/AddOOTD/TagModal/index.tsx b/components/Domain/AddOOTD/TagModal/index.tsx index 57dcd3cb..65b2380d 100644 --- a/components/Domain/AddOOTD/TagModal/index.tsx +++ b/components/Domain/AddOOTD/TagModal/index.tsx @@ -17,23 +17,7 @@ import Toast from '@/components/Toast'; import { useRouter } from 'next/router'; import Alert from '@/components/Alert'; import Background from '@/components/Background'; - -export type ImageWithTag = { - ootdId: number; - ootdImage: string; - ootdImageClothesList?: { - clothesId: number; - clothesImage: string; - coordinate: { xrate: string; yrate: string }; - deviceSize: { deviceWidth: number; deviceHeight: number }; - caption: string; - size?: string; - state?: string; - name?: string; - brand?: string; - category?: string; - }[]; -}[]; +import { ImageWithTag } from '@/utils/types/OOTD.types'; interface AddTagProps { setAddTag: Dispatch>; diff --git a/components/Gallery/index.tsx b/components/Gallery/index.tsx index fa29fdeb..85fc0a54 100644 --- a/components/Gallery/index.tsx +++ b/components/Gallery/index.tsx @@ -5,7 +5,7 @@ import { import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import Carousel from '../Carousel'; import { useRouter } from 'next/router'; -import { ImageWithTag } from '../Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import S from './style'; import NextButton from '../NextButton'; import { Body3, Body4, Caption1 } from '../UI'; diff --git a/pages/add-cloth/AdditionalInfo/index.tsx b/pages/add-cloth/AdditionalInfo/index.tsx index ac032db4..e9ccaca4 100644 --- a/pages/add-cloth/AdditionalInfo/index.tsx +++ b/pages/add-cloth/AdditionalInfo/index.tsx @@ -2,7 +2,7 @@ import { Body2, Body3, Headline1, Title1 } from '@/components/UI'; import Input from '@/components/Input'; import { Dispatch, SetStateAction } from 'react'; import NextButton from '@/components/NextButton'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; import { BrandType } from '@/utils/types/OOTD.types'; import S from '@/pageStyle/add-cloth/AdditionalInfo/style'; diff --git a/pages/add-cloth/BasicInfoFirst/index.tsx b/pages/add-cloth/BasicInfoFirst/index.tsx index 091cdc27..48a100b3 100644 --- a/pages/add-cloth/BasicInfoFirst/index.tsx +++ b/pages/add-cloth/BasicInfoFirst/index.tsx @@ -4,7 +4,7 @@ import Input from '@/components/Input'; import { Body2, Body3, Title1 } from '@/components/UI'; import NextButton from '@/components/NextButton'; import { ClothWhereBuy } from '@/utils/types/OOTD.types'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import ClothCategoryModal, { CategoryListType, } from '@/components/Domain/AddCloth/ClothCategoryModal'; diff --git a/pages/add-cloth/BasicInfoSecond/index.tsx b/pages/add-cloth/BasicInfoSecond/index.tsx index 8a53f638..e51b2e29 100644 --- a/pages/add-cloth/BasicInfoSecond/index.tsx +++ b/pages/add-cloth/BasicInfoSecond/index.tsx @@ -5,7 +5,7 @@ import Input from '@/components/Input'; import NextButton from '@/components/NextButton'; import PlusButton from '@/components/PlusButton'; import { ColorListType } from '@/utils/types/OOTD.types'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; import ColorSpan from '@/components/ColorList/ColorSpan'; import ColorModal from '@/components/Domain/AddCloth/ColorModal'; diff --git a/pages/add-cloth/ClothName/index.tsx b/pages/add-cloth/ClothName/index.tsx index 0f53bda6..d894f43e 100644 --- a/pages/add-cloth/ClothName/index.tsx +++ b/pages/add-cloth/ClothName/index.tsx @@ -2,7 +2,7 @@ import { Headline2 } from '@/components/UI'; import S from '@/pageStyle/add-cloth/ClothName/style'; import Input from '@/components/Input'; import { Dispatch, SetStateAction } from 'react'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import NextButton from '@/components/NextButton'; import NextImage from '@/components/NextImage'; import Portal from '@/components/Portal'; diff --git a/pages/add-cloth/index.tsx b/pages/add-cloth/index.tsx index b64d0572..d3679ffa 100644 --- a/pages/add-cloth/index.tsx +++ b/pages/add-cloth/index.tsx @@ -9,7 +9,7 @@ import { ComponentWithLayout } from '../sign-up'; import { AppLayoutProps } from '@/AppLayout'; import BasicInfoSecond from './BasicInfoSecond'; import AdditionalInfo from './AdditionalInfo'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; import { ColorListType } from '@/utils/types/OOTD.types'; import { useRouter } from 'next/router'; diff --git a/pages/add-ootd/ClothTag/index.tsx b/pages/add-ootd/ClothTag/index.tsx index 3bad5c22..cfe080a1 100644 --- a/pages/add-ootd/ClothTag/index.tsx +++ b/pages/add-ootd/ClothTag/index.tsx @@ -12,9 +12,10 @@ import { import Draggable, { DraggableData, DraggableEvent } from 'react-draggable'; import TagInformation from '@/components/ClothInformation/TagInformation'; import Carousel from '@/components/Carousel'; -import AddTag, { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import AddTag from '@/components/Domain/AddOOTD/TagModal'; import NextImage from '@/components/NextImage'; import Background from '@/components/Background'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; interface ClothTagProps { setImageAndTag: Dispatch>; diff --git a/pages/add-ootd/WriteOOTD/index.tsx b/pages/add-ootd/WriteOOTD/index.tsx index 57dd9ae0..2c9225ca 100644 --- a/pages/add-ootd/WriteOOTD/index.tsx +++ b/pages/add-ootd/WriteOOTD/index.tsx @@ -5,7 +5,7 @@ import { Body4, Button3, Title1 } from '@/components/UI'; import { AiOutlinePlus } from 'react-icons/ai'; import { Style } from '..'; import { AiOutlineClose } from 'react-icons/ai'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import StyleModal from '@/components/Domain/AddOOTD/StyleModal'; import NextButton from '@/components/NextButton'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; diff --git a/pages/add-ootd/index.tsx b/pages/add-ootd/index.tsx index 0482cbcc..c61d5b95 100644 --- a/pages/add-ootd/index.tsx +++ b/pages/add-ootd/index.tsx @@ -9,7 +9,7 @@ import AppBar from '@/components/Appbar'; import { AiOutlineArrowLeft, AiOutlineClose } from 'react-icons/ai'; import { Title1 } from '@/components/UI'; import { useRouter } from 'next/router'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; export interface Style { id: number; diff --git a/pages/edit-cloth/AdditionalInfo/index.tsx b/pages/edit-cloth/AdditionalInfo/index.tsx index 3def04f6..bbcd4ae1 100644 --- a/pages/edit-cloth/AdditionalInfo/index.tsx +++ b/pages/edit-cloth/AdditionalInfo/index.tsx @@ -1,4 +1,4 @@ -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import S from '@/pageStyle/edit-cloth/AdditionalInfo/style'; import Input from '@/components/Input'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; diff --git a/pages/edit-cloth/BasicInfo/index.tsx b/pages/edit-cloth/BasicInfo/index.tsx index 98d9cfe7..f2aaecc3 100644 --- a/pages/edit-cloth/BasicInfo/index.tsx +++ b/pages/edit-cloth/BasicInfo/index.tsx @@ -3,7 +3,7 @@ import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import Input from '@/components/Input'; import { Body3, Title1 } from '@/components/UI'; import { ClothWhereBuy } from '@/utils/types/OOTD.types'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import ClothCategoryModal, { CategoryListType, } from '@/components/Domain/AddCloth/ClothCategoryModal'; diff --git a/pages/edit-cloth/[...ClothNumber].tsx b/pages/edit-cloth/[...ClothNumber].tsx index 274ca6ed..a6f05850 100644 --- a/pages/edit-cloth/[...ClothNumber].tsx +++ b/pages/edit-cloth/[...ClothNumber].tsx @@ -6,7 +6,7 @@ import AdditionalInfo from './AdditionalInfo'; import { ComponentWithLayout } from '../sign-up'; import { AppLayoutProps } from '@/AppLayout'; import { useRouter } from 'next/router'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; import { ColorListType } from '@/utils/types/OOTD.types'; import { BrandType } from '@/utils/types/OOTD.types'; diff --git a/pages/edit-ootd/[...OOTDNumber].tsx b/pages/edit-ootd/[...OOTDNumber].tsx index 6a83a8f8..4e356eca 100644 --- a/pages/edit-ootd/[...OOTDNumber].tsx +++ b/pages/edit-ootd/[...OOTDNumber].tsx @@ -1,6 +1,6 @@ import AppBar from '@/components/Appbar'; import StyleModal from '@/components/Domain/AddOOTD/StyleModal'; -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import Input from '@/components/Input'; import NextButton from '@/components/NextButton'; import { Body3, Body4, Button3, Title1 } from '@/components/UI'; diff --git a/utils/reactNativeMessage.ts b/utils/reactNativeMessage.ts index d5ddc8fd..5e770e6d 100644 --- a/utils/reactNativeMessage.ts +++ b/utils/reactNativeMessage.ts @@ -1,4 +1,4 @@ -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '@/utils/types/OOTD.types'; import { Dispatch, SetStateAction } from 'react'; import { WebViewMessageEvent } from 'react-native-webview'; interface Message { diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index ad47d296..4bd1f227 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -92,3 +92,20 @@ export type GenderTypes = { man: Boolean; woman: Boolean; }; + +export type ImageWithTag = { + ootdId: number; + ootdImage: string; + ootdImageClothesList?: { + clothesId: number; + clothesImage: string; + coordinate: { xrate: string; yrate: string }; + deviceSize: { deviceWidth: number; deviceHeight: number }; + caption: string; + size?: string; + state?: string; + name?: string; + brand?: string; + category?: string; + }[]; +}[]; From baee7109e97abab1689450c0e3ea236b6b4d8131 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Tue, 2 Jul 2024 22:32:39 +0900 Subject: [PATCH 15/24] =?UTF-8?q?feat:=20type=20=EC=84=A4=EC=A0=95=20(#450?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ClothCategory/index.tsx | 2 +- .../ClothInformation/TagInformation/index.tsx | 2 +- components/ClothInformation/index.tsx | 2 +- components/Comment/index.tsx | 23 +-------- components/DeclarationModal/index.tsx | 2 +- .../AddCloth/ClothCategoryModal/index.tsx | 14 +----- .../Domain/AddCloth/ClothSizeModal/index.tsx | 6 +-- .../MyPage/Closet/ClosetCloth/index.tsx | 15 +----- .../MyPage/Closet/FilterModal/index.tsx | 2 +- .../Search/SearchResult/ClosetCloth/index.tsx | 2 +- .../Search/SearchResult/Profile/index.tsx | 8 +-- .../Domain/Search/SearchResult/index.tsx | 5 +- components/PostingComment/index.tsx | 4 +- components/Profile/MyProfile/index.tsx | 2 +- components/Profile/OtherProfile/index.tsx | 2 +- components/Profile/type.tsx | 11 ----- pages/add-cloth/AdditionalInfo/index.tsx | 2 +- pages/add-cloth/BasicInfoFirst/index.tsx | 5 +- pages/add-cloth/BasicInfoSecond/index.tsx | 2 +- pages/add-cloth/index.tsx | 4 +- pages/bookmark/index.tsx | 6 +-- pages/edit-cloth/BasicInfo/index.tsx | 10 ++-- pages/edit-cloth/[...ClothNumber].tsx | 4 +- utils/types/OOTD.types.ts | 49 +++++++++++++++++++ .../type.ts => utils/types/cloth.types.ts | 0 utils/types/index.ts | 1 + utils/types/user.types.ts | 17 +++++++ 27 files changed, 101 insertions(+), 101 deletions(-) delete mode 100644 components/Profile/type.tsx rename components/ClothInformation/type.ts => utils/types/cloth.types.ts (100%) diff --git a/components/ClothCategory/index.tsx b/components/ClothCategory/index.tsx index 28c346df..bd988395 100644 --- a/components/ClothCategory/index.tsx +++ b/components/ClothCategory/index.tsx @@ -1,7 +1,7 @@ import S from './style'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import { Body3 } from '@/components/UI'; -import { CategoryListType } from '../Domain/AddCloth/ClothCategoryModal'; +import { CategoryListType } from '@/utils/types/OOTD.types'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; interface ClothCategoryModalProps { diff --git a/components/ClothInformation/TagInformation/index.tsx b/components/ClothInformation/TagInformation/index.tsx index 2016661f..95fada6c 100644 --- a/components/ClothInformation/TagInformation/index.tsx +++ b/components/ClothInformation/TagInformation/index.tsx @@ -1,7 +1,7 @@ import { Body4, Title2 } from '@/components/UI'; import S from './style'; import Image from 'next/image'; -import { ClothInformationProps } from '../type'; +import { ClothInformationProps } from '@/utils/types/cloth.types'; import { AiFillCloseCircle } from 'react-icons/ai'; export default function TagInformation({ diff --git a/components/ClothInformation/index.tsx b/components/ClothInformation/index.tsx index f3b3a9cc..b1152f14 100644 --- a/components/ClothInformation/index.tsx +++ b/components/ClothInformation/index.tsx @@ -1,4 +1,4 @@ -import { ClothInformationProps } from './type'; +import { ClothInformationProps } from '@/utils/types/cloth.types'; import S from './style'; import { Body4, Title2 } from '../UI'; import ImageWithCaption from '../UI/ImageWithCaption'; diff --git a/components/Comment/index.tsx b/components/Comment/index.tsx index c69b6959..6d1ff2de 100644 --- a/components/Comment/index.tsx +++ b/components/Comment/index.tsx @@ -4,28 +4,7 @@ import S from './style'; import Avatar from '@/public/images/Avatar.svg'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; import NextImage from '../NextImage'; - -export interface CommentProps { - id: number; - userId: number; - userImage: string; - userName: string; - content: string; - timeStamp: string; - type?: 'child'; - view?: 'preview'; - onClickReplyButton?: () => void; - taggedUserName?: string; - myComment?: Boolean; - parentId?: number; - reRender: number; - depth?: number; - setReRender: Dispatch>; - setDeclaration: Dispatch>; - setReportUserName: Dispatch>; - setReportID: Dispatch>; - setBlockID: Dispatch>; -} +import { CommentProps } from '@/utils/types/OOTD.types'; function Comment({ id, diff --git a/components/DeclarationModal/index.tsx b/components/DeclarationModal/index.tsx index 07dbea36..356d837e 100644 --- a/components/DeclarationModal/index.tsx +++ b/components/DeclarationModal/index.tsx @@ -6,7 +6,7 @@ import { Button3, Caption1, Title1 } from '../UI'; import WithdrawBlock from '../Setting/WithdrawBlock'; import ReportApi from '@/apis/domain/Report/ReportApi'; -export type withdrawBlockType = { +type withdrawBlockType = { id: number; message: string; }[]; diff --git a/components/Domain/AddCloth/ClothCategoryModal/index.tsx b/components/Domain/AddCloth/ClothCategoryModal/index.tsx index c73b7b27..1906f4fb 100644 --- a/components/Domain/AddCloth/ClothCategoryModal/index.tsx +++ b/components/Domain/AddCloth/ClothCategoryModal/index.tsx @@ -5,6 +5,7 @@ import { Title1 } from '@/components/UI'; import NextButton from '@/components/NextButton'; import ClothCategory from '@/components/ClothCategory'; import { AiOutlineClose } from 'react-icons/ai'; +import { CategoryListType } from '@/utils/types/OOTD.types'; interface ClothCategoryModalProps { isOpen: Boolean; @@ -13,19 +14,6 @@ interface ClothCategoryModalProps { categoryInitial?: CategoryListType[] | null; } -export type CategoryType = { - id: number; - name: string; - state?: Boolean; -}; - -export type CategoryListType = { - id: number; - name: string; - state?: Boolean; - detailCategories?: CategoryType[]; -}; - export default function ClothCategoryModal({ isOpen, setIsOpen, diff --git a/components/Domain/AddCloth/ClothSizeModal/index.tsx b/components/Domain/AddCloth/ClothSizeModal/index.tsx index 3ece3293..64ed414c 100644 --- a/components/Domain/AddCloth/ClothSizeModal/index.tsx +++ b/components/Domain/AddCloth/ClothSizeModal/index.tsx @@ -5,6 +5,7 @@ import { Body2, Title1 } from '@/components/UI'; import NextButton from '@/components/NextButton'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; import { AiOutlineClose } from 'react-icons/ai'; +import { SizeItem } from '@/utils/types/OOTD.types'; interface ClothSizeProps { isOpen: Boolean; @@ -14,11 +15,6 @@ interface ClothSizeProps { clothSizeInitial: SizeItem | null; } -export type SizeItem = { - id: number; - name: string; -}; - export type SizeListType = SizeItem[][]; export default function ClothSizeModal({ diff --git a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx index 659a809d..720427b5 100644 --- a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx +++ b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx @@ -5,7 +5,7 @@ import ImageList from '@/components/ImageList'; import { useRouter } from 'next/router'; import { AiOutlineDown } from 'react-icons/ai'; import FilterModal from '../FilterModal'; -import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; +import { CategoryListType } from '@/utils/types/OOTD.types'; import { BrandType } from '@/utils/types/OOTD.types'; import useInfiniteScroll from '@/hooks/useInfiniteScroll'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; @@ -16,7 +16,7 @@ import { ClothDataType } from '@/pages/cloth/[...ClothNumber]'; import Background from '@/components/Background'; import useRememberScroll from '@/hooks/useRememberScroll'; import useEffectAfterMount from '@/hooks/useEffectAfterMount'; -import { ColorListType } from '@/utils/types/OOTD.types'; +import { ColorListType, FilterData } from '@/utils/types/OOTD.types'; interface ClosetClothProps { showingId: number; @@ -27,17 +27,6 @@ export type myPageClothType = { clothImage: string; }; -export interface FilterData { - category: CategoryListType[] | null; - color: ColorListType | null; - brand: BrandType[] | null; - isOpen: Boolean | null; - gender?: { - man: Boolean; - woman: Boolean; - }; -} - export default function ClosetCloth({ showingId }: ClosetClothProps) { const router = useRouter(); const localUserId = useRecoilValue(userId); diff --git a/components/Domain/MyPage/Closet/FilterModal/index.tsx b/components/Domain/MyPage/Closet/FilterModal/index.tsx index adffc2bc..9893f198 100644 --- a/components/Domain/MyPage/Closet/FilterModal/index.tsx +++ b/components/Domain/MyPage/Closet/FilterModal/index.tsx @@ -9,7 +9,7 @@ import { AiOutlineClose } from 'react-icons/ai'; import Button from '@/components/Button'; import { BrandType } from '@/utils/types/OOTD.types'; import BrandList from '@/components/BrandList'; -import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; +import { CategoryListType } from '@/utils/types/OOTD.types'; import { MyPageApi } from '@/apis/domain/MyPage/MyPageApi'; import { useRouter } from 'next/router'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; diff --git a/components/Domain/Search/SearchResult/ClosetCloth/index.tsx b/components/Domain/Search/SearchResult/ClosetCloth/index.tsx index 755f92fd..13f2166b 100644 --- a/components/Domain/Search/SearchResult/ClosetCloth/index.tsx +++ b/components/Domain/Search/SearchResult/ClosetCloth/index.tsx @@ -7,7 +7,7 @@ import { AiOutlineDown } from 'react-icons/ai'; import SubHead from '../SubHead'; import Spinner from '@/components/Spinner'; import FilterModal from '@/components/Domain/MyPage/Closet/FilterModal'; -import { FilterData } from '@/components/Domain/MyPage/Closet/ClosetCloth'; +import { FilterData } from '@/utils/types/OOTD.types'; import Portal from '@/components/Portal'; import EmptyFilteredResult from '../EmptyFilteredResult'; import Background from '@/components/Background'; diff --git a/components/Domain/Search/SearchResult/Profile/index.tsx b/components/Domain/Search/SearchResult/Profile/index.tsx index bdc5b668..d17e9750 100644 --- a/components/Domain/Search/SearchResult/Profile/index.tsx +++ b/components/Domain/Search/SearchResult/Profile/index.tsx @@ -14,13 +14,7 @@ import Button from '@/components/Button'; import Avatar from '@/public/images/Avatar.svg'; import NextImage from '@/components/NextImage'; import PublicApi from '@/apis/domain/Public/PublicApi'; - -export type ProfileListType = { - id: number; - name: string; - profileImage: string; - isFollow: Boolean; -}; +import { ProfileListType } from '@/utils/types/user.types'; interface ProfileProps { profileList: ProfileListType[]; diff --git a/components/Domain/Search/SearchResult/index.tsx b/components/Domain/Search/SearchResult/index.tsx index cafc2594..c0cf8a9c 100644 --- a/components/Domain/Search/SearchResult/index.tsx +++ b/components/Domain/Search/SearchResult/index.tsx @@ -1,6 +1,6 @@ import S from './style'; import ClosetCloth from './ClosetCloth'; -import Profile, { ProfileListType } from './Profile'; +import Profile from './Profile'; import EmptySearch from '@/components/EmptySearch'; import { UserApi } from '@/apis/domain/User/UserApi'; import { useRouter } from 'next/router'; @@ -9,9 +9,10 @@ import { useEffect, useState } from 'react'; import useEffectAfterMount from '@/hooks/useEffectAfterMount'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; import TabView from '@/components/TabView'; -import { FilterData } from '../../MyPage/Closet/ClosetCloth'; +import { FilterData } from '@/utils/types/OOTD.types'; import useRememberScroll from '@/hooks/useRememberScroll'; import { OOTDListType } from '@/utils/types/OOTD.types'; +import { ProfileListType } from '@/utils/types/user.types'; interface searchResultProps { keywordsValue: string; diff --git a/components/PostingComment/index.tsx b/components/PostingComment/index.tsx index 62924f0b..0ca60203 100644 --- a/components/PostingComment/index.tsx +++ b/components/PostingComment/index.tsx @@ -7,9 +7,9 @@ import React, { useState, } from 'react'; import S from './style'; -import Comment, { CommentProps } from '../Comment'; +import Comment from '../Comment'; import { Body4, Caption1, Title1 } from '../UI'; -import { CommentStateType } from '@/utils/types/OOTD.types'; +import { CommentStateType, CommentProps } from '@/utils/types/OOTD.types'; import { useRecoilValue } from 'recoil'; import { userId } from '@/utils/recoil/atom'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; diff --git a/components/Profile/MyProfile/index.tsx b/components/Profile/MyProfile/index.tsx index 647e6116..34a1d711 100644 --- a/components/Profile/MyProfile/index.tsx +++ b/components/Profile/MyProfile/index.tsx @@ -2,7 +2,7 @@ import ProfileLayout from '../ProfileLayout'; import S from './style'; import Title1 from '@/components/UI/TypoGraphy/Title1'; import Body from '@/components/UI/TypoGraphy/Body4'; -import { ProfileType } from '../type'; +import { ProfileType } from '@/utils/types/user.types'; export default function MyProfile({ isUser, diff --git a/components/Profile/OtherProfile/index.tsx b/components/Profile/OtherProfile/index.tsx index f19e7007..fbdfd0df 100644 --- a/components/Profile/OtherProfile/index.tsx +++ b/components/Profile/OtherProfile/index.tsx @@ -1,6 +1,6 @@ import ProfileLayout from '../ProfileLayout'; import S from './style'; -import { ProfileType } from '../type'; +import { ProfileType } from '@/utils/types/user.types'; import { Body2, Body4 } from '@/components/UI'; import { useRouter } from 'next/router'; diff --git a/components/Profile/type.tsx b/components/Profile/type.tsx deleted file mode 100644 index 78e53cb2..00000000 --- a/components/Profile/type.tsx +++ /dev/null @@ -1,11 +0,0 @@ -interface ProfileType { - isUser: Boolean; - userImage: string; - userName: string; - follow?: number; - myCloth?: number; - className?: string; - showingId?: number; -} - -export type { ProfileType }; diff --git a/pages/add-cloth/AdditionalInfo/index.tsx b/pages/add-cloth/AdditionalInfo/index.tsx index e9ccaca4..0b0d789a 100644 --- a/pages/add-cloth/AdditionalInfo/index.tsx +++ b/pages/add-cloth/AdditionalInfo/index.tsx @@ -3,7 +3,7 @@ import Input from '@/components/Input'; import { Dispatch, SetStateAction } from 'react'; import NextButton from '@/components/NextButton'; import { ImageWithTag } from '@/utils/types/OOTD.types'; -import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; +import { CategoryListType } from '@/utils/types/OOTD.types'; import { BrandType } from '@/utils/types/OOTD.types'; import S from '@/pageStyle/add-cloth/AdditionalInfo/style'; import NextImage from '@/components/NextImage'; diff --git a/pages/add-cloth/BasicInfoFirst/index.tsx b/pages/add-cloth/BasicInfoFirst/index.tsx index 48a100b3..a411c1d2 100644 --- a/pages/add-cloth/BasicInfoFirst/index.tsx +++ b/pages/add-cloth/BasicInfoFirst/index.tsx @@ -5,9 +5,8 @@ import { Body2, Body3, Title1 } from '@/components/UI'; import NextButton from '@/components/NextButton'; import { ClothWhereBuy } from '@/utils/types/OOTD.types'; import { ImageWithTag } from '@/utils/types/OOTD.types'; -import ClothCategoryModal, { - CategoryListType, -} from '@/components/Domain/AddCloth/ClothCategoryModal'; +import ClothCategoryModal from '@/components/Domain/AddCloth/ClothCategoryModal'; +import { CategoryListType } from '@/utils/types/OOTD.types'; import WhereToBuyModal from '@/components/Domain/AddCloth/WhereToBuyModal'; import { BrandType } from '@/utils/types/OOTD.types'; import BrandModal from '@/components/Domain/AddCloth/BrandModal'; diff --git a/pages/add-cloth/BasicInfoSecond/index.tsx b/pages/add-cloth/BasicInfoSecond/index.tsx index e51b2e29..8c417bd9 100644 --- a/pages/add-cloth/BasicInfoSecond/index.tsx +++ b/pages/add-cloth/BasicInfoSecond/index.tsx @@ -6,7 +6,7 @@ import NextButton from '@/components/NextButton'; import PlusButton from '@/components/PlusButton'; import { ColorListType } from '@/utils/types/OOTD.types'; import { ImageWithTag } from '@/utils/types/OOTD.types'; -import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; +import { CategoryListType } from '@/utils/types/OOTD.types'; import ColorSpan from '@/components/ColorList/ColorSpan'; import ColorModal from '@/components/Domain/AddCloth/ColorModal'; import ClothSizeModal, { diff --git a/pages/add-cloth/index.tsx b/pages/add-cloth/index.tsx index d3679ffa..68361c49 100644 --- a/pages/add-cloth/index.tsx +++ b/pages/add-cloth/index.tsx @@ -10,11 +10,11 @@ import { AppLayoutProps } from '@/AppLayout'; import BasicInfoSecond from './BasicInfoSecond'; import AdditionalInfo from './AdditionalInfo'; import { ImageWithTag } from '@/utils/types/OOTD.types'; -import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; +import { CategoryListType } from '@/utils/types/OOTD.types'; import { ColorListType } from '@/utils/types/OOTD.types'; import { useRouter } from 'next/router'; import ClothName from './ClothName'; -import { SizeItem } from '@/components/Domain/AddCloth/ClothSizeModal'; +import { SizeItem } from '@/utils/types/OOTD.types'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; import { BrandType } from '@/utils/types/OOTD.types'; import { useRecoilValue } from 'recoil'; diff --git a/pages/bookmark/index.tsx b/pages/bookmark/index.tsx index db162e03..fc2915c6 100644 --- a/pages/bookmark/index.tsx +++ b/pages/bookmark/index.tsx @@ -15,15 +15,15 @@ import useEffectAfterMount from '@/hooks/useEffectAfterMount'; import Background from '@/components/Background'; import useRememberScroll from '@/hooks/useRememberScroll'; -export type OOTDdataType = { +type OOTDBookmarkDataType = { ootdId: number; ootdBookmarkId: number; ootdImage: string; ootdImageCount: number; }; -export type BookmarkListType = { - content: OOTDdataType[]; +type BookmarkListType = { + content: OOTDBookmarkDataType[]; page: number; size: number; isLast: Boolean; diff --git a/pages/edit-cloth/BasicInfo/index.tsx b/pages/edit-cloth/BasicInfo/index.tsx index f2aaecc3..6937f104 100644 --- a/pages/edit-cloth/BasicInfo/index.tsx +++ b/pages/edit-cloth/BasicInfo/index.tsx @@ -4,16 +4,14 @@ import Input from '@/components/Input'; import { Body3, Title1 } from '@/components/UI'; import { ClothWhereBuy } from '@/utils/types/OOTD.types'; import { ImageWithTag } from '@/utils/types/OOTD.types'; -import ClothCategoryModal, { - CategoryListType, -} from '@/components/Domain/AddCloth/ClothCategoryModal'; +import ClothCategoryModal from '@/components/Domain/AddCloth/ClothCategoryModal'; +import { CategoryListType } from '@/utils/types/OOTD.types'; import WhereToBuyModal from '@/components/Domain/AddCloth/WhereToBuyModal'; import { BrandType } from '@/utils/types/OOTD.types'; import BrandModal from '@/components/Domain/AddCloth/BrandModal'; import { ColorListType } from '@/utils/types/OOTD.types'; -import ClothSizeModal, { - SizeItem, -} from '@/components/Domain/AddCloth/ClothSizeModal'; +import ClothSizeModal from '@/components/Domain/AddCloth/ClothSizeModal'; +import { SizeItem } from '@/utils/types/OOTD.types'; import ColorSpan from '@/components/ColorList/ColorSpan'; import PlusButton from '@/components/PlusButton'; import ColorModal from '@/components/Domain/AddCloth/ColorModal'; diff --git a/pages/edit-cloth/[...ClothNumber].tsx b/pages/edit-cloth/[...ClothNumber].tsx index a6f05850..d6312ded 100644 --- a/pages/edit-cloth/[...ClothNumber].tsx +++ b/pages/edit-cloth/[...ClothNumber].tsx @@ -7,10 +7,10 @@ import { ComponentWithLayout } from '../sign-up'; import { AppLayoutProps } from '@/AppLayout'; import { useRouter } from 'next/router'; import { ImageWithTag } from '@/utils/types/OOTD.types'; -import { CategoryListType } from '@/components/Domain/AddCloth/ClothCategoryModal'; +import { CategoryListType } from '@/utils/types/OOTD.types'; import { ColorListType } from '@/utils/types/OOTD.types'; import { BrandType } from '@/utils/types/OOTD.types'; -import { SizeItem } from '@/components/Domain/AddCloth/ClothSizeModal'; +import { SizeItem } from '@/utils/types/OOTD.types'; import BasicInfo from './BasicInfo'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; import { ClothWhereBuy } from '@/utils/types/OOTD.types'; diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index 4bd1f227..214f5bcc 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -1,3 +1,5 @@ +import React, { Dispatch, SetStateAction } from 'react'; + export interface BrandType { id: number; name: string; @@ -24,6 +26,28 @@ export interface CommentStateType { commentParentId?: number; } +export interface CommentProps { + id: number; + userId: number; + userImage: string; + userName: string; + content: string; + timeStamp: string; + type?: 'child'; + view?: 'preview'; + onClickReplyButton?: () => void; + taggedUserName?: string; + myComment?: Boolean; + parentId?: number; + reRender: number; + depth?: number; + setReRender: Dispatch>; + setDeclaration: Dispatch>; + setReportUserName: Dispatch>; + setReportID: Dispatch>; + setBlockID: Dispatch>; +} + export interface OOTDType { id: number; contents: string; //본문 @@ -109,3 +133,28 @@ export type ImageWithTag = { category?: string; }[]; }[]; + +type CategoryType = { + id: number; + name: string; + state?: boolean; + detailCategories?: CategoryType[]; +}; + +export type CategoryListType = CategoryType; + +export type SizeItem = { + id: number; + name: string; +}; + +export interface FilterData { + category: CategoryListType[] | null; + color: ColorListType | null; + brand: BrandType[] | null; + isOpen: Boolean | null; + gender?: { + man: Boolean; + woman: Boolean; + }; +} diff --git a/components/ClothInformation/type.ts b/utils/types/cloth.types.ts similarity index 100% rename from components/ClothInformation/type.ts rename to utils/types/cloth.types.ts diff --git a/utils/types/index.ts b/utils/types/index.ts index d7b98f28..7576e137 100644 --- a/utils/types/index.ts +++ b/utils/types/index.ts @@ -1,2 +1,3 @@ export * as OOTDTypes from './OOTD.types'; export * as userTypes from './user.types'; +export * as ClothTypes from './cloth.types'; diff --git a/utils/types/user.types.ts b/utils/types/user.types.ts index 20698ce7..254c8e78 100644 --- a/utils/types/user.types.ts +++ b/utils/types/user.types.ts @@ -12,3 +12,20 @@ export interface UserProfileDataType { ootdCount: number; clothesCount: number; } + +export interface ProfileType { + isUser: Boolean; + userImage: string; + userName: string; + follow?: number; + myCloth?: number; + className?: string; + showingId?: number; +} + +export type ProfileListType = { + id: number; + name: string; + profileImage: string; + isFollow: Boolean; +}; From 3d50c71589f30c1668e9ad2b30b0e5427f457904 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Tue, 2 Jul 2024 22:45:49 +0900 Subject: [PATCH 16/24] feat: setting type (#430) --- components/Domain/AddOOTD/TagModal/index.tsx | 2 +- .../MyPage/Closet/ClosetCloth/index.tsx | 2 +- components/Domain/OOTD/UserCloth/index.tsx | 11 +------- components/Domain/Search/Recents/index.tsx | 2 +- .../Setting/AnnouncementBlock/index.tsx | 2 +- pages/announcement/index.tsx | 8 +----- pages/blocked-account/index.tsx | 2 +- pages/cloth/[...ClothNumber].tsx | 19 +------------ pages/search/index.tsx | 6 +--- utils/types/OOTD.types.ts | 5 ++++ utils/types/cloth.types.ts | 28 +++++++++++++++++++ utils/types/index.ts | 1 + utils/types/setting.types.ts | 6 ++++ 13 files changed, 49 insertions(+), 45 deletions(-) create mode 100644 utils/types/setting.types.ts diff --git a/components/Domain/AddOOTD/TagModal/index.tsx b/components/Domain/AddOOTD/TagModal/index.tsx index 65b2380d..30bc0afd 100644 --- a/components/Domain/AddOOTD/TagModal/index.tsx +++ b/components/Domain/AddOOTD/TagModal/index.tsx @@ -10,7 +10,7 @@ import useInfiniteScroll from '@/hooks/useInfiniteScroll'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; import { useRecoilValue, useSetRecoilState } from 'recoil'; import { storedImageKey, userId } from '@/utils/recoil/atom'; -import { UserClothDataType } from '../../OOTD/UserCloth'; +import { UserClothDataType } from '@/utils/types/cloth.types'; import Spinner from '@/components/Spinner'; import useEffectAfterMount from '@/hooks/useEffectAfterMount'; import Toast from '@/components/Toast'; diff --git a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx index 720427b5..46ef447d 100644 --- a/components/Domain/MyPage/Closet/ClosetCloth/index.tsx +++ b/components/Domain/MyPage/Closet/ClosetCloth/index.tsx @@ -12,7 +12,7 @@ import ClothApi from '@/apis/domain/Cloth/ClothApi'; import Spinner from '@/components/Spinner'; import { useRecoilValue } from 'recoil'; import { userId } from '@/utils/recoil/atom'; -import { ClothDataType } from '@/pages/cloth/[...ClothNumber]'; +import { ClothDataType } from '@/utils/types/cloth.types'; import Background from '@/components/Background'; import useRememberScroll from '@/hooks/useRememberScroll'; import useEffectAfterMount from '@/hooks/useEffectAfterMount'; diff --git a/components/Domain/OOTD/UserCloth/index.tsx b/components/Domain/OOTD/UserCloth/index.tsx index 5521cbbb..183dcb29 100644 --- a/components/Domain/OOTD/UserCloth/index.tsx +++ b/components/Domain/OOTD/UserCloth/index.tsx @@ -6,16 +6,7 @@ import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; import useInfiniteScroll from '@/hooks/useInfiniteScroll'; - -export interface UserClothDataType { - id: number; - isTagged: number; - imageUrl: string; - clothesName: string; - brandName: string; - categoryName: string; - sizeName: string; -} +import { UserClothDataType } from '@/utils/types/cloth.types'; interface UserClothProps { userName: string; diff --git a/components/Domain/Search/Recents/index.tsx b/components/Domain/Search/Recents/index.tsx index 996fbbda..ca7a5122 100644 --- a/components/Domain/Search/Recents/index.tsx +++ b/components/Domain/Search/Recents/index.tsx @@ -1,7 +1,7 @@ import { Title1, Caption1, Button3 } from '@/components/UI'; import S from './style'; import { AiOutlineClose } from 'react-icons/ai'; -import { keywordsInterface } from '@/pages/search'; +import { keywordsInterface } from '@/utils/types/OOTD.types'; import { Dispatch, SetStateAction } from 'react'; interface recentsProps { diff --git a/components/Setting/AnnouncementBlock/index.tsx b/components/Setting/AnnouncementBlock/index.tsx index 5eedbe81..923d4bed 100644 --- a/components/Setting/AnnouncementBlock/index.tsx +++ b/components/Setting/AnnouncementBlock/index.tsx @@ -1,4 +1,4 @@ -import { AnnoucementDataType } from '@/pages/announcement'; +import { AnnoucementDataType } from '@/utils/types/setting.types'; import S from './style'; import { Body3, Caption1 } from '@/components/UI'; import { useState } from 'react'; diff --git a/pages/announcement/index.tsx b/pages/announcement/index.tsx index 55439b4b..82b6141d 100644 --- a/pages/announcement/index.tsx +++ b/pages/announcement/index.tsx @@ -5,13 +5,7 @@ import theme from '@/styles/theme'; import { useRouter } from 'next/router'; import { useState } from 'react'; import { AiOutlineArrowLeft } from 'react-icons/ai'; - -export interface AnnoucementDataType { - date: string; - headline: string; - newState: Boolean; - body: string; -} +import { AnnoucementDataType } from '@/utils/types/setting.types'; export default function Announcement() { const router = useRouter(); diff --git a/pages/blocked-account/index.tsx b/pages/blocked-account/index.tsx index b05a2979..f70014dd 100644 --- a/pages/blocked-account/index.tsx +++ b/pages/blocked-account/index.tsx @@ -18,7 +18,7 @@ import Avatar from '@/public/images/Avatar.svg'; import BlockUserAlert from '@/components/Domain/BlockUser/BlockUserAlert'; import PublicApi from '@/apis/domain/Public/PublicApi'; -export interface UserBlockListDataType { +interface UserBlockListDataType { id: number; userId: number; userName: string; diff --git a/pages/cloth/[...ClothNumber].tsx b/pages/cloth/[...ClothNumber].tsx index b955e7fd..29e8a47c 100644 --- a/pages/cloth/[...ClothNumber].tsx +++ b/pages/cloth/[...ClothNumber].tsx @@ -24,24 +24,7 @@ import ReceivedDeclarationModal from '@/components/ReceivedDeclarationModal'; import NextImage from '@/components/NextImage'; import Background from '@/components/Background'; import useRememberScroll from '@/hooks/useRememberScroll'; - -export interface ClothDataType { - id: number; - name: string; - userName: string; - brand: { id: number; name: string }; - category: { id: number; categoryName: string; parentCategoryName: string }; - size: { id: number; name: string; lineNo: string }; - colors: { id: number; name: string; colorCode: string }[]; - isPrivate: Boolean; - memo: string; - purchaseStore: string; - purchaseStoreType: string; - purchaseDate: string; - imageUrl: string; - createdAt: string; - userId: number; -} +import { ClothDataType } from '@/utils/types/cloth.types'; const Cloth = () => { const router = useRouter(); diff --git a/pages/search/index.tsx b/pages/search/index.tsx index 4abcea7f..6e5404c7 100644 --- a/pages/search/index.tsx +++ b/pages/search/index.tsx @@ -5,11 +5,7 @@ import SearchResult from '@/components/Domain/Search/SearchResult'; import Recents from '@/components/Domain/Search/Recents'; import { useRouter } from 'next/router'; import Toast from '@/components/Toast'; - -export interface keywordsInterface { - id: number; - text: string; -} +import { keywordsInterface } from '@/utils/types/OOTD.types'; export default function Search() { const [keywords, setKeywords] = useState([]); diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index 214f5bcc..8b206a09 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -158,3 +158,8 @@ export interface FilterData { woman: Boolean; }; } + +export interface keywordsInterface { + id: number; + text: string; +} diff --git a/utils/types/cloth.types.ts b/utils/types/cloth.types.ts index bc36b404..46a77aff 100644 --- a/utils/types/cloth.types.ts +++ b/utils/types/cloth.types.ts @@ -14,3 +14,31 @@ export interface ClothInformationProps { onClick?: () => void; onTouchEnd?: () => void; } + +export interface ClothDataType { + id: number; + name: string; + userName: string; + brand: { id: number; name: string }; + category: { id: number; categoryName: string; parentCategoryName: string }; + size: { id: number; name: string; lineNo: string }; + colors: { id: number; name: string; colorCode: string }[]; + isPrivate: Boolean; + memo: string; + purchaseStore: string; + purchaseStoreType: string; + purchaseDate: string; + imageUrl: string; + createdAt: string; + userId: number; +} + +export interface UserClothDataType { + id: number; + isTagged: number; + imageUrl: string; + clothesName: string; + brandName: string; + categoryName: string; + sizeName: string; +} diff --git a/utils/types/index.ts b/utils/types/index.ts index 7576e137..fb3609d2 100644 --- a/utils/types/index.ts +++ b/utils/types/index.ts @@ -1,3 +1,4 @@ export * as OOTDTypes from './OOTD.types'; export * as userTypes from './user.types'; export * as ClothTypes from './cloth.types'; +export * as settingTypes from './setting.types'; diff --git a/utils/types/setting.types.ts b/utils/types/setting.types.ts new file mode 100644 index 00000000..080a1697 --- /dev/null +++ b/utils/types/setting.types.ts @@ -0,0 +1,6 @@ +export interface AnnoucementDataType { + date: string; + headline: string; + newState: Boolean; + body: string; +} From 7733da72f3dad6bc3cd13a3129feead6c9829558 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Tue, 2 Jul 2024 22:54:02 +0900 Subject: [PATCH 17/24] =?UTF-8?q?feat:=20style=20type=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20(#450)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Domain/AddOOTD/StyleModal/index.tsx | 2 +- components/Domain/Setting/LikeInfo/index.tsx | 2 +- pages/add-ootd/index.tsx | 7 +------ pages/edit-ootd/[...OOTDNumber].tsx | 2 +- pages/like-info/index.tsx | 2 +- pages/sign-up/index.tsx | 2 +- utils/types/OOTD.types.ts | 6 ++++++ 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/components/Domain/AddOOTD/StyleModal/index.tsx b/components/Domain/AddOOTD/StyleModal/index.tsx index a59b27b2..1844628a 100644 --- a/components/Domain/AddOOTD/StyleModal/index.tsx +++ b/components/Domain/AddOOTD/StyleModal/index.tsx @@ -3,7 +3,7 @@ import S from './style'; import { AiOutlineClose } from 'react-icons/ai'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import Input from '@/components/Input'; -import { Style } from '@/pages/add-ootd'; +import { Style } from '@/utils/types/OOTD.types'; import NextButton from '@/components/NextButton'; import Modal from '@/components/Modal'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; diff --git a/components/Domain/Setting/LikeInfo/index.tsx b/components/Domain/Setting/LikeInfo/index.tsx index 61453b2a..b264268d 100644 --- a/components/Domain/Setting/LikeInfo/index.tsx +++ b/components/Domain/Setting/LikeInfo/index.tsx @@ -1,6 +1,6 @@ import Input from '@/components/Input'; import S from './style'; -import { Style } from '@/pages/add-ootd'; +import { Style } from '@/utils/types/OOTD.types'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; import { UserApi } from '@/apis/domain/User/UserApi'; diff --git a/pages/add-ootd/index.tsx b/pages/add-ootd/index.tsx index c61d5b95..404fe331 100644 --- a/pages/add-ootd/index.tsx +++ b/pages/add-ootd/index.tsx @@ -10,12 +10,7 @@ import { AiOutlineArrowLeft, AiOutlineClose } from 'react-icons/ai'; import { Title1 } from '@/components/UI'; import { useRouter } from 'next/router'; import { ImageWithTag } from '@/utils/types/OOTD.types'; - -export interface Style { - id: number; - name: string; - state?: Boolean; -} +import { Style } from '@/utils/types/OOTD.types'; const AddOOTD: ComponentWithLayout = () => { const steps = ['편집', '태그', '게시하기']; diff --git a/pages/edit-ootd/[...OOTDNumber].tsx b/pages/edit-ootd/[...OOTDNumber].tsx index 4e356eca..d5699001 100644 --- a/pages/edit-ootd/[...OOTDNumber].tsx +++ b/pages/edit-ootd/[...OOTDNumber].tsx @@ -11,7 +11,7 @@ import { AiOutlineClose, AiOutlinePlus, } from 'react-icons/ai'; -import { Style } from '../add-ootd'; +import { Style } from '@/utils/types/OOTD.types'; import { AppLayoutProps } from '@/AppLayout'; import { ComponentWithLayout } from '../sign-up'; import { useRouter } from 'next/router'; diff --git a/pages/like-info/index.tsx b/pages/like-info/index.tsx index 17dd7d5e..399378b4 100644 --- a/pages/like-info/index.tsx +++ b/pages/like-info/index.tsx @@ -6,7 +6,7 @@ import { Button3, Title1 } from '@/components/UI'; import { useEffect, useState } from 'react'; import GenderInput from '@/components/Domain/SignUp/GenderInput'; import LikeInfoStyleInput from '@/components/Domain/Setting/LikeInfo'; -import { Style } from '../add-ootd'; +import { Style } from '@/utils/types/OOTD.types'; import { UserApi } from '@/apis/domain/User/UserApi'; import { ComponentWithLayout } from '../sign-up'; import { AppLayoutProps } from '@/AppLayout'; diff --git a/pages/sign-up/index.tsx b/pages/sign-up/index.tsx index 5171e5bb..93b8c71a 100644 --- a/pages/sign-up/index.tsx +++ b/pages/sign-up/index.tsx @@ -10,7 +10,7 @@ import AppBar from '@/components/Appbar'; import { AppLayoutProps } from '@/AppLayout'; import { AiOutlineArrowLeft, AiOutlineClose } from 'react-icons/ai'; import { useRouter } from 'next/router'; -import { Style } from '../add-ootd'; +import { Style } from '@/utils/types/OOTD.types'; import { RegisterApi } from '@/apis/domain/Register/RegisterApi'; interface ComponentWithLayout extends FC { diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index 8b206a09..80834f68 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -163,3 +163,9 @@ export interface keywordsInterface { id: number; text: string; } + +export interface Style { + id: number; + name: string; + state?: Boolean; +} From a491cd669ed30754fa039e042b0c0926dc31a4fc Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Tue, 2 Jul 2024 23:13:59 +0900 Subject: [PATCH 18/24] =?UTF-8?q?refactor:=20card=20type=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20(#450)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Card/CardLayout/index.tsx | 2 +- components/Card/MainTopUserCard/index.tsx | 2 +- components/Domain/SignUp/StyleInput/index.tsx | 2 +- components/Card/type.ts => utils/types/card.type.ts | 0 utils/types/index.ts | 1 + 5 files changed, 4 insertions(+), 3 deletions(-) rename components/Card/type.ts => utils/types/card.type.ts (100%) diff --git a/components/Card/CardLayout/index.tsx b/components/Card/CardLayout/index.tsx index 45fcbd64..9e54d85f 100644 --- a/components/Card/CardLayout/index.tsx +++ b/components/Card/CardLayout/index.tsx @@ -1,5 +1,5 @@ import { Layout, CardBody } from './style'; -import { CardProps } from '../type'; +import { CardProps } from '@/utils/types/card.type'; import ImageWithCaption from '@/components/UI/ImageWithCaption'; export default function Card(props: CardProps) { diff --git a/components/Card/MainTopUserCard/index.tsx b/components/Card/MainTopUserCard/index.tsx index 3ce5f2ca..25b4f18a 100644 --- a/components/Card/MainTopUserCard/index.tsx +++ b/components/Card/MainTopUserCard/index.tsx @@ -1,5 +1,5 @@ import { Body4, Title2 } from '@/components/UI'; -import { CardComponentProps } from '../type'; +import { CardComponentProps } from '@/utils/types/card.type'; import Card from '../CardLayout'; import { Layout } from './style'; diff --git a/components/Domain/SignUp/StyleInput/index.tsx b/components/Domain/SignUp/StyleInput/index.tsx index eb346df3..da3dacde 100644 --- a/components/Domain/SignUp/StyleInput/index.tsx +++ b/components/Domain/SignUp/StyleInput/index.tsx @@ -1,6 +1,6 @@ import Input from '@/components/Input'; import S from './style'; -import { Style } from '@/pages/add-ootd'; +import { Style } from '@/utils/types/OOTD.types'; import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; diff --git a/components/Card/type.ts b/utils/types/card.type.ts similarity index 100% rename from components/Card/type.ts rename to utils/types/card.type.ts diff --git a/utils/types/index.ts b/utils/types/index.ts index fb3609d2..725b6279 100644 --- a/utils/types/index.ts +++ b/utils/types/index.ts @@ -2,3 +2,4 @@ export * as OOTDTypes from './OOTD.types'; export * as userTypes from './user.types'; export * as ClothTypes from './cloth.types'; export * as settingTypes from './setting.types'; +export * as cardTypes from './card.type'; From acabe8b4b7740d0a0fb6cbedfd9513d12ebc8c96 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Tue, 2 Jul 2024 23:18:48 +0900 Subject: [PATCH 19/24] feat: query setting (#450) --- apis/_api/auth.ts | 2 +- apis/_service/auth.service.ts | 2 +- apis/domain/SignIn/SignInApi.tsx | 2 +- pages/sign-in/[...callback].tsx | 7 +------ utils/types/setting.types.ts | 6 ++++++ 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apis/_api/auth.ts b/apis/_api/auth.ts index e7dc21b6..cb6221c1 100644 --- a/apis/_api/auth.ts +++ b/apis/_api/auth.ts @@ -4,7 +4,7 @@ import { NEXT_PUBLIC_KAKAO_URI, } from '@/constants/develop.constants'; import { postRegistUserInfoPayload } from './type'; -import { QueryParams } from '@/pages/sign-in/[...callback]'; +import { QueryParams } from '@/utils/types/setting.types'; import axios from 'axios'; export const login = async (payload: QueryParams) => { diff --git a/apis/_service/auth.service.ts b/apis/_service/auth.service.ts index 0781d569..7f1e56c2 100644 --- a/apis/_service/auth.service.ts +++ b/apis/_service/auth.service.ts @@ -1,6 +1,6 @@ import { authApi } from '@/apis/_api'; import { postRegistUserInfoPayload } from '../_api/type'; -import { QueryParams } from '@/pages/sign-in/[...callback]'; +import { QueryParams } from '@/utils/types/setting.types'; export const login = async (payload: QueryParams) => { const data = await authApi.login(payload); diff --git a/apis/domain/SignIn/SignInApi.tsx b/apis/domain/SignIn/SignInApi.tsx index 327bfeaf..84b6a6d2 100644 --- a/apis/domain/SignIn/SignInApi.tsx +++ b/apis/domain/SignIn/SignInApi.tsx @@ -5,7 +5,7 @@ import { NEXT_PUBLIC_NAVER_URI, } from '@/constants/develop.constants'; import { useRouter } from 'next/router'; -import { QueryParams } from '@/pages/sign-in/[...callback]'; +import { QueryParams } from '@/utils/types/setting.types'; import { useState } from 'react'; import { kakaoLogin } from '@/apis/_api/auth'; diff --git a/pages/sign-in/[...callback].tsx b/pages/sign-in/[...callback].tsx index c07c3859..da0a4297 100644 --- a/pages/sign-in/[...callback].tsx +++ b/pages/sign-in/[...callback].tsx @@ -3,12 +3,7 @@ import { useEffect } from 'react'; import { SignInApi } from '@/apis/domain/SignIn/SignInApi'; import { RegisterApi } from '@/apis/domain/Register/RegisterApi'; import Spinner from '@/components/Spinner'; - -export interface QueryParams { - code?: string; - state?: string; - callback?: string[]; -} +import { QueryParams } from '@/utils/types/setting.types'; export default function SignUpCallbackPage() { const router = useRouter(); diff --git a/utils/types/setting.types.ts b/utils/types/setting.types.ts index 080a1697..a333a58e 100644 --- a/utils/types/setting.types.ts +++ b/utils/types/setting.types.ts @@ -4,3 +4,9 @@ export interface AnnoucementDataType { newState: Boolean; body: string; } + +export interface QueryParams { + code?: string; + state?: string; + callback?: string[]; +} From 033ce32eea8470edea4faf80437c52300275f87e Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Tue, 2 Jul 2024 23:41:51 +0900 Subject: [PATCH 20/24] feat: gender type (#450) --- components/Domain/MyPage/Closet/FilterModal/index.tsx | 6 +----- .../Domain/Search/SearchResult/ClosetCloth/index.tsx | 10 +++++----- utils/types/OOTD.types.ts | 4 ++++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/Domain/MyPage/Closet/FilterModal/index.tsx b/components/Domain/MyPage/Closet/FilterModal/index.tsx index 9893f198..559dd37a 100644 --- a/components/Domain/MyPage/Closet/FilterModal/index.tsx +++ b/components/Domain/MyPage/Closet/FilterModal/index.tsx @@ -13,11 +13,7 @@ import { CategoryListType } from '@/utils/types/OOTD.types'; import { MyPageApi } from '@/apis/domain/MyPage/MyPageApi'; import { useRouter } from 'next/router'; import ClothApi from '@/apis/domain/Cloth/ClothApi'; -import { - GenderTypes, - SearchFilterData, -} from '@/components/Domain/Search/SearchResult/ClosetCloth'; - +import { GenderTypes, SearchFilterData } from '@/utils/types/OOTD.types'; import { ColorListType } from '@/utils/types/OOTD.types'; interface FilterModalProps { diff --git a/components/Domain/Search/SearchResult/ClosetCloth/index.tsx b/components/Domain/Search/SearchResult/ClosetCloth/index.tsx index 13f2166b..51aaf37c 100644 --- a/components/Domain/Search/SearchResult/ClosetCloth/index.tsx +++ b/components/Domain/Search/SearchResult/ClosetCloth/index.tsx @@ -12,7 +12,11 @@ import Portal from '@/components/Portal'; import EmptyFilteredResult from '../EmptyFilteredResult'; import Background from '@/components/Background'; import useRememberScroll from '@/hooks/useRememberScroll'; -import { OOTDListType, GenderTypes } from '@/utils/types/OOTD.types'; +import { + OOTDListType, + GenderTypes, + SearchFilterData, +} from '@/utils/types/OOTD.types'; interface ClosetClothProps { OOTDTotal: number; @@ -27,10 +31,6 @@ interface ClosetClothProps { setSortStandard: Dispatch>; } -export interface SearchFilterData extends FilterData { - gender?: GenderTypes; -} - export default function ClosetCloth({ OOTDTotal, OOTDList, diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index 80834f68..1a515055 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -169,3 +169,7 @@ export interface Style { name: string; state?: Boolean; } + +export interface SearchFilterData extends FilterData { + gender?: GenderTypes; +} From f371ec4022829ab7e0eab8fb94ff30cbaeab1818 Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Tue, 2 Jul 2024 23:45:09 +0900 Subject: [PATCH 21/24] feat: image props (#450) --- components/UI/ImageWithCaption/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/UI/ImageWithCaption/index.tsx b/components/UI/ImageWithCaption/index.tsx index 2e20d10c..df2095aa 100644 --- a/components/UI/ImageWithCaption/index.tsx +++ b/components/UI/ImageWithCaption/index.tsx @@ -1,4 +1,4 @@ -import { ImageProps } from '@/components/Card/type'; +import { ImageProps } from '@/utils/types/card.type'; import { ImageCaption, ImageFigure } from './style'; import { Caption2 } from '../TypoGraphy'; import NextImage from '@/components/NextImage'; From ad2046c67a6662ee1bb4f2ad8b8dc00e8474501a Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Wed, 3 Jul 2024 00:32:28 +0900 Subject: [PATCH 22/24] =?UTF-8?q?feat:=20type=20interface=20=EA=B5=AC?= =?UTF-8?q?=EB=B6=84=20(#450)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/add-cloth/BasicInfoSecond/index.tsx | 5 ++--- utils/types/OOTD.types.ts | 12 ++++++------ utils/types/user.types.ts | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/pages/add-cloth/BasicInfoSecond/index.tsx b/pages/add-cloth/BasicInfoSecond/index.tsx index 8c417bd9..fdb3c466 100644 --- a/pages/add-cloth/BasicInfoSecond/index.tsx +++ b/pages/add-cloth/BasicInfoSecond/index.tsx @@ -9,9 +9,8 @@ import { ImageWithTag } from '@/utils/types/OOTD.types'; import { CategoryListType } from '@/utils/types/OOTD.types'; import ColorSpan from '@/components/ColorList/ColorSpan'; import ColorModal from '@/components/Domain/AddCloth/ColorModal'; -import ClothSizeModal, { - SizeItem, -} from '@/components/Domain/AddCloth/ClothSizeModal'; +import ClothSizeModal from '@/components/Domain/AddCloth/ClothSizeModal'; +import { SizeItem } from '@/utils/types/OOTD.types'; import AddClothAlert from '@/components/Domain/AddCloth/AddClothAlert'; import { BrandType } from '@/utils/types/OOTD.types'; import { ClothWhereBuy } from '@/utils/types/OOTD.types'; diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index 1a515055..c2aed0a2 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -106,16 +106,16 @@ export interface OOTDType { }[]; } -export type OOTDListType = { +export interface OOTDListType { id: number; imageUrl: string; imageCount?: number; -}; +} -export type GenderTypes = { +export interface GenderTypes { man: Boolean; woman: Boolean; -}; +} export type ImageWithTag = { ootdId: number; @@ -143,10 +143,10 @@ type CategoryType = { export type CategoryListType = CategoryType; -export type SizeItem = { +export interface SizeItem { id: number; name: string; -}; +} export interface FilterData { category: CategoryListType[] | null; diff --git a/utils/types/user.types.ts b/utils/types/user.types.ts index 254c8e78..08b5bf2e 100644 --- a/utils/types/user.types.ts +++ b/utils/types/user.types.ts @@ -23,9 +23,9 @@ export interface ProfileType { showingId?: number; } -export type ProfileListType = { +export interface ProfileListType { id: number; name: string; profileImage: string; isFollow: Boolean; -}; +} From ede3e94dfe394717b50043eb807d23560916464a Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Wed, 3 Jul 2024 22:21:30 +0900 Subject: [PATCH 23/24] =?UTF-8?q?feat:=20alram=20type=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20(#450)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Card/MainFavoriteCard/index.tsx | 11 +---------- components/Domain/Alarm/index.tsx | 15 +-------------- components/Domain/Main/LikeOOTD/index.tsx | 2 +- pages/Alarm/index.tsx | 3 ++- utils/types/OOTD.types.ts | 10 ++++++++++ utils/types/setting.types.ts | 14 ++++++++++++++ 6 files changed, 29 insertions(+), 26 deletions(-) diff --git a/components/Card/MainFavoriteCard/index.tsx b/components/Card/MainFavoriteCard/index.tsx index aacbe46e..88dac42c 100644 --- a/components/Card/MainFavoriteCard/index.tsx +++ b/components/Card/MainFavoriteCard/index.tsx @@ -5,16 +5,7 @@ import LikeToggle from '@/components/Toggle/LikeToggle'; import { useState } from 'react'; import Link from 'next/link'; import { OOTDApi } from '@/apis/domain/OOTD/OOTDApi'; - -export interface MainFavoriteCardProps { - ootdId: number; - ootdImageUrl: string; - ootdImageCount: number; - writerId: number; - writerProfileImage?: string; - writerName: string; - onClick?: () => void; -} +import { MainFavoriteCardProps } from '@/utils/types/OOTD.types'; export default function MainFavoriteCard({ ootdId, diff --git a/components/Domain/Alarm/index.tsx b/components/Domain/Alarm/index.tsx index e90eff9c..a79ea1d3 100644 --- a/components/Domain/Alarm/index.tsx +++ b/components/Domain/Alarm/index.tsx @@ -5,20 +5,7 @@ import Avatar from '@/public/images/Avatar.svg'; import { useRouter } from 'next/router'; import { AlarmApi } from '@/apis/domain/Alarm/AlarmApi'; import React from 'react'; - -export interface AlarmType { - id: number; - profileImage: string | null; - timeType: string; - timeStamp: string; - message: string; - userName: string; - content?: string; - contentImage?: string; - goUrl: string; - userId: number; - className: string; -} +import { AlarmType } from '@/utils/types/setting.types'; export default function Alarms({ id, diff --git a/components/Domain/Main/LikeOOTD/index.tsx b/components/Domain/Main/LikeOOTD/index.tsx index ec0a316e..d0ee627d 100644 --- a/components/Domain/Main/LikeOOTD/index.tsx +++ b/components/Domain/Main/LikeOOTD/index.tsx @@ -3,7 +3,7 @@ import S from './style'; import { MainFavoriteCard } from '@/components/Card'; import Carousel from '@/components/Carousel'; import { useEffect, useState } from 'react'; -import { MainFavoriteCardProps } from '@/components/Card/MainFavoriteCard'; +import { MainFavoriteCardProps } from '@/utils/types/OOTD.types'; import { useRouter } from 'next/router'; import { MainApi } from '@/apis/domain/Main/MainApi'; diff --git a/pages/Alarm/index.tsx b/pages/Alarm/index.tsx index d104cff0..82ee2569 100644 --- a/pages/Alarm/index.tsx +++ b/pages/Alarm/index.tsx @@ -1,6 +1,6 @@ import { AlarmApi } from '@/apis/domain/Alarm/AlarmApi'; import AppBar from '@/components/Appbar'; -import Alarms, { AlarmType } from '@/components/Domain/Alarm'; +import Alarms from '@/components/Domain/Alarm'; import AlarmLayout from '@/components/Domain/Alarm/AlarmLayout'; import NoAlarm from '@/components/Domain/Alarm/NoAlarm'; import { Title1 } from '@/components/UI'; @@ -9,6 +9,7 @@ import S from '@/pageStyle/alarm/style'; import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; import { AiOutlineArrowLeft } from 'react-icons/ai'; +import { AlarmType } from '@/utils/types/setting.types'; interface FetchedAlarmType { timeType: string; diff --git a/utils/types/OOTD.types.ts b/utils/types/OOTD.types.ts index c2aed0a2..5efc1a5e 100644 --- a/utils/types/OOTD.types.ts +++ b/utils/types/OOTD.types.ts @@ -173,3 +173,13 @@ export interface Style { export interface SearchFilterData extends FilterData { gender?: GenderTypes; } + +export interface MainFavoriteCardProps { + ootdId: number; + ootdImageUrl: string; + ootdImageCount: number; + writerId: number; + writerProfileImage?: string; + writerName: string; + onClick?: () => void; +} diff --git a/utils/types/setting.types.ts b/utils/types/setting.types.ts index a333a58e..7bfdf6cb 100644 --- a/utils/types/setting.types.ts +++ b/utils/types/setting.types.ts @@ -10,3 +10,17 @@ export interface QueryParams { state?: string; callback?: string[]; } + +export interface AlarmType { + id: number; + profileImage: string | null; + timeType: string; + timeStamp: string; + message: string; + userName: string; + content?: string; + contentImage?: string; + goUrl: string; + userId: number; + className: string; +} From deed866be0bc395b2ac87ad78603e9362c2f96ee Mon Sep 17 00:00:00 2001 From: "wjddusgnl676@naver.com" Date: Wed, 3 Jul 2024 22:36:40 +0900 Subject: [PATCH 24/24] =?UTF-8?q?feat:=20setting=20type=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20(#450)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/add-ootd/WriteOOTD/index.tsx | 2 +- pages/agree/index.tsx | 2 +- pages/bookmark/index.tsx | 2 +- pages/edit-mypage/index.tsx | 2 +- pages/sign-up/StyleInfo/index.tsx | 2 +- utils/recoil/atom.tsx | 3 ++- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pages/add-ootd/WriteOOTD/index.tsx b/pages/add-ootd/WriteOOTD/index.tsx index 2c9225ca..898e36d7 100644 --- a/pages/add-ootd/WriteOOTD/index.tsx +++ b/pages/add-ootd/WriteOOTD/index.tsx @@ -3,7 +3,7 @@ import S from '@/pageStyle/add-ootd/WriteOOTD/style'; import { Dispatch, SetStateAction, useState } from 'react'; import { Body4, Button3, Title1 } from '@/components/UI'; import { AiOutlinePlus } from 'react-icons/ai'; -import { Style } from '..'; +import { Style } from '@/utils/types/OOTD.types'; import { AiOutlineClose } from 'react-icons/ai'; import { ImageWithTag } from '@/utils/types/OOTD.types'; import StyleModal from '@/components/Domain/AddOOTD/StyleModal'; diff --git a/pages/agree/index.tsx b/pages/agree/index.tsx index daa96e63..6b64f3db 100644 --- a/pages/agree/index.tsx +++ b/pages/agree/index.tsx @@ -1,6 +1,6 @@ import React, { FC, useEffect, useState } from 'react'; import { AppLayoutProps } from '@/AppLayout'; -import { Style } from '../add-ootd'; +import { Style } from '@/utils/types/OOTD.types'; import S from '@/pageStyle/agree/style'; import AppBar from '@/components/Appbar'; import { AiOutlineArrowLeft } from 'react-icons/ai'; diff --git a/pages/bookmark/index.tsx b/pages/bookmark/index.tsx index fc2915c6..f941396c 100644 --- a/pages/bookmark/index.tsx +++ b/pages/bookmark/index.tsx @@ -92,7 +92,7 @@ export default function Bookmark() { }; const { getUserBookmarkList, deleteBookmarkList } = BookmarkApi(); - const [bookmarkList, setBookmarkList] = useState([]); + const [bookmarkList, setBookmarkList] = useState([]); const fetchDataFunction = async (bookmarkPage: number, size: number) => { if (!router.isReady) return; diff --git a/pages/edit-mypage/index.tsx b/pages/edit-mypage/index.tsx index 8ecb987b..33e92e9e 100644 --- a/pages/edit-mypage/index.tsx +++ b/pages/edit-mypage/index.tsx @@ -4,7 +4,7 @@ import { AiOutlineArrowLeft, AiOutlineSetting } from 'react-icons/ai'; import { useRouter } from 'next/router'; import Edit from '@/components/Domain/MyPage/Edit'; import React, { FC, useEffect, useState } from 'react'; -import { Style } from '../add-ootd'; +import { Style } from '@/utils/types/OOTD.types'; import { AppLayoutProps } from '@/AppLayout'; import Background from '@/components/Background'; diff --git a/pages/sign-up/StyleInfo/index.tsx b/pages/sign-up/StyleInfo/index.tsx index bd48f847..d83b2715 100644 --- a/pages/sign-up/StyleInfo/index.tsx +++ b/pages/sign-up/StyleInfo/index.tsx @@ -2,7 +2,7 @@ import { Dispatch, SetStateAction } from 'react'; import S from '@/pageStyle/sign-up/StyleInfo/style'; import GenderInput from '@/components/Domain/SignUp/GenderInput'; import StyleInput from '@/components/Domain/SignUp/StyleInput'; -import { Style } from '@/pages/add-ootd'; +import { Style } from '@/utils/types/OOTD.types'; interface StyleInfoProps { gender: Boolean; diff --git a/utils/recoil/atom.tsx b/utils/recoil/atom.tsx index 9a61ab7c..64f6099c 100644 --- a/utils/recoil/atom.tsx +++ b/utils/recoil/atom.tsx @@ -1,4 +1,5 @@ -import { ImageWithTag } from '@/components/Domain/AddOOTD/TagModal'; +import { ImageWithTag } from '../types/OOTD.types'; + import { atom } from 'recoil'; import { recoilPersist } from 'recoil-persist';