Skip to content

Commit

Permalink
Merge pull request #1585 from 42organization/Fix/#1581-takgu-game-pag…
Browse files Browse the repository at this point in the history
…e-color

[Fix] 탁구 게임 기록 페이지 색 변경 오류 수정
  • Loading branch information
JeongRon authored Jan 7, 2025
2 parents 2be9275 + ed5ef53 commit 6987a5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions components/takgu/game/GameResultList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@ interface GameResultListProps {
radioMode?: SeasonMode;
}

type pageType = 'main' | 'game' | 'profile';

const pageTypeMap: Record<string, pageType> = {
'/takgu': 'main',
'/takgu/game': 'game',
};

export default function GameResultList({
path,
radioMode,
}: GameResultListProps) {
const { data, status, fetchNextPage, isLast, clickedGameItem, pathName } =
useGameResultList(path);

const page =
pathName === '/' ? 'main' : pathName === '/game' ? 'game' : 'profile';
const page: pageType = pageTypeMap[pathName] || 'profile';

if (status === 'loading') return <GameResultEmptyItem status={status} />;

Expand Down
2 changes: 1 addition & 1 deletion components/takgu/mode/modeWraps/GameModeWrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function GameModeWrap({
setRadioMode(e.target.value as SeasonMode);
};

const isGamePage = useRouter().pathname === '/game';
const isGamePage = useRouter().pathname === '/takgu/game';

return (
<div>
Expand Down

0 comments on commit 6987a5f

Please sign in to comment.