Skip to content

Commit 66e0d6d

Browse files
committed
feat: 미니게임 필터링 로직 추가
- 숨겨진 미니게임 리스트(HIDDEN_MINI_GAMES) 추가 - HIDDEN_MINI_GAMES에 포함된 미니게임 필터링 로직 적용 - 필터링된 미니게임만 GameActionButton에 렌더링되도록 구현
1 parent 550b958 commit 66e0d6d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

frontend/src/features/room/lobby/components/MiniGameSection/MiniGameSection.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import ScreenReaderOnly from '@/components/@common/ScreenReaderOnly/ScreenReader
44
import GameActionButtonSkeleton from '@/components/@composition/GameActionButtonSkeleton/GameActionButtonSkeleton';
55
import { usePlayerType } from '@/contexts/PlayerType/PlayerTypeContext';
66
import {
7+
HIDDEN_MINI_GAMES,
78
MINI_GAME_DESCRIPTION_MAP,
89
MINI_GAME_ICON_MAP,
910
MINI_GAME_NAME_MAP,
@@ -46,7 +47,9 @@ export const MiniGameSection = ({ selectedMiniGames, handleMiniGameClick }: Prop
4647
{loading ? (
4748
<GameActionButtonSkeleton />
4849
) : (
49-
miniGames?.map((miniGame) => (
50+
miniGames
51+
?.filter((miniGame) => !HIDDEN_MINI_GAMES.includes(miniGame))
52+
.map((miniGame) => (
5053
<GameActionButton
5154
key={miniGame}
5255
isSelected={selectedMiniGames.includes(miniGame)}

frontend/src/types/miniGame/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export const MINI_GAME_NAME_MAP = {
1818

1919
export type MiniGameType = keyof typeof MINI_GAME_NAME_MAP;
2020

21+
export const HIDDEN_MINI_GAMES: MiniGameType[] = ['BOMB_RELAY'];
22+
2123
export const MINI_GAME_DESCRIPTION_MAP: Record<MiniGameType, string[]> = {
2224
CARD_GAME: ['2라운드 동안 매번 카드 1장씩 뒤집어', '가장 높은 점수를 내보세요!'],
2325
RACING_GAME: ['화면을 클릭해 속도를 높여서', '가장 먼저 도착하세요!'],

0 commit comments

Comments
 (0)