From f910347d7d7c4db34ec15b74e4ae64529c61fd8c Mon Sep 17 00:00:00 2001 From: seongminn Date: Thu, 30 Nov 2023 04:54:21 +0900 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20minuts=EC=9D=84=20=EB=91=90=EC=9E=90?= =?UTF-8?q?=EB=A6=AC=EB=A1=9C=20=EC=B6=9C=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/MatchCard/pieces/Label.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/common/MatchCard/pieces/Label.tsx b/src/components/common/MatchCard/pieces/Label.tsx index 2157e90..baa6895 100644 --- a/src/components/common/MatchCard/pieces/Label.tsx +++ b/src/components/common/MatchCard/pieces/Label.tsx @@ -14,7 +14,8 @@ export default function Label({ className }: LabelProps) { return (
{sportsName} {gameName} From 959eef8df487e5d625c1d2a6bcbc2cf45e562a23 Mon Sep 17 00:00:00 2001 From: seongminn Date: Thu, 30 Nov 2023 05:00:14 +0900 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=ED=8C=80=20=EC=88=9C=EC=84=9C?= =?UTF-8?q?=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EC=83=89=EC=83=81=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/match/CommentForm/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/match/CommentForm/index.tsx b/src/components/match/CommentForm/index.tsx index e604f61..9c16c4f 100644 --- a/src/components/match/CommentForm/index.tsx +++ b/src/components/match/CommentForm/index.tsx @@ -13,8 +13,8 @@ type CommentFormProps = { const teamColor = [ 'bg-cheer-left', - 'bg-[#fb923c] ', 'bg-cheer-right', + 'bg-[#fb923c] ', 'bg-[#22c55e]', ] as const; @@ -25,7 +25,9 @@ export default function CommentForm({ scrollToBottom, }: CommentFormProps) { const [inputValue, setInputValue] = useState(''); - const [selectedTeamId, setSelectedTeamId] = useState(1); + const [selectedTeamId, setSelectedTeamId] = useState( + matchTeams[0].gameTeamId, + ); const handleCommentSubmit = ( e: FormEvent, From be1c9e4c4b08677aaa696318f5c17d1dfd8988fb Mon Sep 17 00:00:00 2001 From: seongminn Date: Thu, 30 Nov 2023 05:14:04 +0900 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20query=20params=EB=A5=BC=20=EC=8A=A4?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=ED=81=AC=20=EC=BC=80=EC=9D=B4=EC=8A=A4?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Sidebar/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/Sidebar/index.tsx b/src/components/common/Sidebar/index.tsx index 6dc9347..c14db54 100644 --- a/src/components/common/Sidebar/index.tsx +++ b/src/components/common/Sidebar/index.tsx @@ -52,7 +52,7 @@ export default function Sidebar({ From ec37c9aef271132b8c90fe8c2c193ee195bc1e76 Mon Sep 17 00:00:00 2001 From: seongminn Date: Thu, 30 Nov 2023 05:14:48 +0900 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20=EC=B4=88=EA=B8=B0=20league=20id?= =?UTF-8?q?=EB=A5=BC=20=EA=B3=A0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 91a3644..b1709ce 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -22,10 +22,10 @@ export default function Home() { return (
에러
} + errorFallback={() => } loadingFallback={} > - + {data => ( Date: Thu, 30 Nov 2023 14:42:26 +0900 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=EB=8D=94=EB=AF=B8=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../useSportsListByLeagueId/Fetcher.tsx | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/queries/useSportsListByLeagueId/Fetcher.tsx b/src/queries/useSportsListByLeagueId/Fetcher.tsx index 37c063a..b36efd9 100644 --- a/src/queries/useSportsListByLeagueId/Fetcher.tsx +++ b/src/queries/useSportsListByLeagueId/Fetcher.tsx @@ -9,28 +9,13 @@ type SportsListFetcherProps = { children: (data: SportsType[]) => ReactNode; }; -const DUMMY = [ - { - sportId: 1, - name: '축구', - }, - { - sportId: 3, - name: '농구', - }, - { - sportId: 2, - name: '롤', - }, -]; - export default function SportsListFetcher({ leagueId, children, }: SportsListFetcherProps) { - const { error } = useSportsListByLeagueId(leagueId); + const { sportsList, error } = useSportsListByLeagueId(leagueId); if (error) throw error; - return children(DUMMY); + return children(sportsList); } From f91c8c37bcc5c50b3ee910200387c5ef7765da81 Mon Sep 17 00:00:00 2001 From: seongminn Date: Thu, 30 Nov 2023 15:30:14 +0900 Subject: [PATCH 6/6] fix: query string sports_id -> sport_id --- src/api/match.ts | 4 ++-- src/constants/queryParams.ts | 2 +- src/queries/useMatchList/Fetcher.tsx | 2 +- src/queries/useMatchList/query.ts | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/api/match.ts b/src/api/match.ts index b57a418..2b98ddd 100644 --- a/src/api/match.ts +++ b/src/api/match.ts @@ -14,9 +14,9 @@ import { convertObjectToQueryString } from '@/utils/queryString'; import instance from '.'; export type MatchListParams = { - sportsId?: string[]; + sport_id?: string[]; status: MatchStatus; - leagueId?: string; + league_id?: string; cursor?: number; }; diff --git a/src/constants/queryParams.ts b/src/constants/queryParams.ts index b2a3137..ebb9e7d 100644 --- a/src/constants/queryParams.ts +++ b/src/constants/queryParams.ts @@ -1,5 +1,5 @@ export const QUERY_PARAMS = { league: 'league_id', - sports: 'sports_id', + sports: 'sport_id', status: 'status', }; diff --git a/src/queries/useMatchList/Fetcher.tsx b/src/queries/useMatchList/Fetcher.tsx index 9181a13..3501b49 100644 --- a/src/queries/useMatchList/Fetcher.tsx +++ b/src/queries/useMatchList/Fetcher.tsx @@ -26,7 +26,7 @@ export default function MatchListFetcher({ ...props }: MatchListFetcherProps) { const { matchList, error, hasNextPage, fetchNextPage, isFetching } = - useMatchList(props satisfies { status: string }); + useMatchList(props); if (error) throw error; diff --git a/src/queries/useMatchList/query.ts b/src/queries/useMatchList/query.ts index 267e0a7..009996d 100644 --- a/src/queries/useMatchList/query.ts +++ b/src/queries/useMatchList/query.ts @@ -3,18 +3,18 @@ import { useSuspenseInfiniteQuery } from '@tanstack/react-query'; import { getMatchList, MatchListParams } from '@/api/match'; export const useMatchList = ({ - sportsId, + sport_id, status = 'playing', - leagueId, + league_id, }: Omit) => { const { data, error, isFetching, hasNextPage, fetchNextPage } = useSuspenseInfiniteQuery({ - queryKey: ['match-list', sportsId, status, leagueId], + queryKey: ['match-list', sport_id, status, league_id], queryFn: ({ pageParam }) => getMatchList({ - sportsId, + sport_id, status, - leagueId, + league_id, cursor: pageParam, }), initialPageParam: 0,