Skip to content

Commit

Permalink
fix: type에 따른 build error
Browse files Browse the repository at this point in the history
  • Loading branch information
김성욱 authored and 김성욱 committed Oct 31, 2023
1 parent 58011aa commit 606ea8d
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
15 changes: 14 additions & 1 deletion app/src/@shared/types/Coalition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
*/
9 changes: 8 additions & 1 deletion app/src/@shared/types/Promo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ export type Promo = {
promo: number;
};

//ToDo: graphql의 Coalition 타입이 수정되면 삭제할 것
/* ToDo: graphql의 Coalition 타입이 수정되면 삭제할 것
현재 타입
export type Promo = {
beginAt: string;
promo: number;
userCount: number;
};
*/
20 changes: 20 additions & 0 deletions app/src/@shared/types/UserProfile.d.ts
Original file line number Diff line number Diff line change
@@ -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 타입이 수정되면 삭제할 것 */
2 changes: 1 addition & 1 deletion app/src/Profile/components/UserProfile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion app/src/Profile/contexts/MyUserProfileContext.ts
Original file line number Diff line number Diff line change
@@ -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<UserProfile>(
{} as UserProfile,
Expand Down
2 changes: 1 addition & 1 deletion app/src/Profile/contexts/UserProfileContext.ts
Original file line number Diff line number Diff line change
@@ -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<UserProfile>({} as UserProfile);

0 comments on commit 606ea8d

Please sign in to comment.