From 606ea8df5346cff45d1324b20fd228ce686e06de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=B1=EC=9A=B1?= Date: Tue, 31 Oct 2023 17:39:14 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20type=EC=97=90=20=EB=94=B0=EB=A5=B8=20bui?= =?UTF-8?q?ld=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Number/NumberVersus.tsx | 2 +- app/src/@shared/types/Coalition.d.ts | 15 +++++++++++++- app/src/@shared/types/Promo.d.ts | 9 ++++++++- app/src/@shared/types/UserProfile.d.ts | 20 +++++++++++++++++++ .../Profile/components/UserProfile/index.tsx | 2 +- .../Profile/contexts/MyUserProfileContext.ts | 2 +- .../Profile/contexts/UserProfileContext.ts | 2 +- 7 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 app/src/@shared/types/UserProfile.d.ts diff --git a/app/src/@shared/components/DashboardContentView/Number/NumberVersus.tsx b/app/src/@shared/components/DashboardContentView/Number/NumberVersus.tsx index 284bdac9..f4080d19 100644 --- a/app/src/@shared/components/DashboardContentView/Number/NumberVersus.tsx +++ b/app/src/@shared/components/DashboardContentView/Number/NumberVersus.tsx @@ -1,6 +1,6 @@ import { useTheme } from '@emotion/react'; -import type { UserProfile } from '@shared/__generated__/graphql'; +import type { UserProfile } from '@shared/types/UserProfile'; import { Avatar, H3MediumText, HStack, Text } from '@shared/ui-kit'; type NumberVersusProps = { diff --git a/app/src/@shared/types/Coalition.d.ts b/app/src/@shared/types/Coalition.d.ts index 2afd6c0b..ff8f5afa 100644 --- a/app/src/@shared/types/Coalition.d.ts +++ b/app/src/@shared/types/Coalition.d.ts @@ -6,4 +6,17 @@ export type Coalition = { color: string; }; -//ToDo: graphql의 Coalition 타입이 수정되면 삭제할 것 +/* ToDo: graphql의 Coalition 타입이 수정되면 삭제할 것 +현재 타입 +export type Coalition = { + id: number; + name: string; + imgUrl: string; + coverUrl: string; + color: string; + imageUrl: string; + userId: number; + score: number; + slug: string; +}; +*/ diff --git a/app/src/@shared/types/Promo.d.ts b/app/src/@shared/types/Promo.d.ts index 147e9b1c..27671db8 100644 --- a/app/src/@shared/types/Promo.d.ts +++ b/app/src/@shared/types/Promo.d.ts @@ -3,4 +3,11 @@ export type Promo = { promo: number; }; -//ToDo: graphql의 Coalition 타입이 수정되면 삭제할 것 +/* ToDo: graphql의 Coalition 타입이 수정되면 삭제할 것 +현재 타입 +export type Promo = { + beginAt: string; + promo: number; + userCount: number; +}; +*/ diff --git a/app/src/@shared/types/UserProfile.d.ts b/app/src/@shared/types/UserProfile.d.ts new file mode 100644 index 00000000..5a7b39c5 --- /dev/null +++ b/app/src/@shared/types/UserProfile.d.ts @@ -0,0 +1,20 @@ +import { Coalition } from '@shared/types/Coalition'; + +export type UserProfile = { + id: number; + login: string; + imgUrl?: string | null; + grade: string; + displayname: string; + level: number; + coalition?: Coalition | null; + titles: Array<{ + titleId: number; + name: string; + selected: boolean; + createdAt: string; + updatedAt: string; + }>; +}; + +/* ToDo: graphql의 Coalition 타입이 수정되면 삭제할 것 */ diff --git a/app/src/Profile/components/UserProfile/index.tsx b/app/src/Profile/components/UserProfile/index.tsx index ffe51832..bceaad47 100644 --- a/app/src/Profile/components/UserProfile/index.tsx +++ b/app/src/Profile/components/UserProfile/index.tsx @@ -4,7 +4,7 @@ import { truncate } from 'lodash-es'; import { useContext } from 'react'; import { UserProfileContext } from '@/Profile/contexts/UserProfileContext'; -import type { Coalition } from '@shared/__generated__/graphql'; +import type { Coalition } from '@shared/types/Coalition'; import coalition_black_cover from '@shared/assets/coalition/cover/coalition-black-cover.jpg'; import coalition_gam_cover from '@shared/assets/coalition/cover/coalition-gam-cover.jpg'; import coalition_gon_cover from '@shared/assets/coalition/cover/coalition-gon-cover.jpg'; diff --git a/app/src/Profile/contexts/MyUserProfileContext.ts b/app/src/Profile/contexts/MyUserProfileContext.ts index b62c2b89..3d1b5a4b 100644 --- a/app/src/Profile/contexts/MyUserProfileContext.ts +++ b/app/src/Profile/contexts/MyUserProfileContext.ts @@ -1,6 +1,6 @@ import { createContext } from 'react'; -import type { UserProfile } from '@shared/__generated__/graphql'; +import type { UserProfile } from '@shared/types/UserProfile'; export const MyUserProfileContext = createContext( {} as UserProfile, diff --git a/app/src/Profile/contexts/UserProfileContext.ts b/app/src/Profile/contexts/UserProfileContext.ts index cb4b8cb9..7cb2722c 100644 --- a/app/src/Profile/contexts/UserProfileContext.ts +++ b/app/src/Profile/contexts/UserProfileContext.ts @@ -1,5 +1,5 @@ import { createContext } from 'react'; -import type { UserProfile } from '@shared/__generated__/graphql'; +import type { UserProfile } from '@shared/types/UserProfile'; export const UserProfileContext = createContext({} as UserProfile);