From c995e24670d64dd55f4eb6c57bc288a63d0e247d Mon Sep 17 00:00:00 2001 From: Dan Donahoe Date: Wed, 23 Oct 2024 12:57:25 -0400 Subject: [PATCH] feat(color): colorizing the box component (#133) --- src/ui/game/component/GameBox/index.tsx | 7 +++- src/ui/game/component/GameBox/type.tsx | 7 ++-- src/ui/game/component/GameDev/index.tsx | 46 +++++++++++------------- src/ui/game/component/GameFoe/index.tsx | 2 +- src/ui/game/screen/GameLobby/FoeList.tsx | 28 +++++++++------ 5 files changed, 49 insertions(+), 41 deletions(-) diff --git a/src/ui/game/component/GameBox/index.tsx b/src/ui/game/component/GameBox/index.tsx index a60adf65..a8373f75 100644 --- a/src/ui/game/component/GameBox/index.tsx +++ b/src/ui/game/component/GameBox/index.tsx @@ -1,4 +1,5 @@ import { GameBoxCenteredProps, GameBoxDefaultProps, GameBoxType, Props } from './type'; +import { CardColor } from '../../../../api/src/constant/card-color.enum'; import { App } from '../../../AppContext'; import { Box } from '@mantine/core'; import { RFC } from '@app/ui/type'; @@ -7,6 +8,7 @@ import { useContext } from 'react'; export const GameBox : RFC = ({ type = GameBoxType.Default, + color = CardColor.Black, size = 'md', children, }) => { @@ -24,7 +26,9 @@ export const GameBox : RFC = ({ switch(type) { case GameBoxType.Default: return ( - + {children} ); @@ -33,6 +37,7 @@ export const GameBox : RFC = ({ return ( {children} diff --git a/src/ui/game/component/GameBox/type.tsx b/src/ui/game/component/GameBox/type.tsx index 019be675..ee91982f 100644 --- a/src/ui/game/component/GameBox/type.tsx +++ b/src/ui/game/component/GameBox/type.tsx @@ -1,10 +1,13 @@ +import { CardColor } from '../../../../api/src/constant/card-color.enum'; import { MantineSize } from "@mantine/core"; + export type GameBoxSize = Extract; export type Props = React.PropsWithChildren<{ - type ?: GameBoxType; - size ?: GameBoxSize; + color ?: CardColor; + type ?: GameBoxType; + size ?: GameBoxSize; }>; type GameBoxCustom = Omit; diff --git a/src/ui/game/component/GameDev/index.tsx b/src/ui/game/component/GameDev/index.tsx index 31cfdc0e..0bb75ab1 100644 --- a/src/ui/game/component/GameDev/index.tsx +++ b/src/ui/game/component/GameDev/index.tsx @@ -1,33 +1,27 @@ - +import { GameTextType } from '../GameText/type'; import { GameStack } from '../GameStack'; import { GameText } from '../GameText'; -import { GameTextType } from '../GameText/type'; -export const GameDev = () => { +export const GameDev = () => + + + + {'CrudeCards is Open Source'} + + + }}> + {'Browse the GitHub Repo.'} + - - {'CrudeCards is Open Source'} - - - {'Browse the GitHub Repo.'} - - - {'Or don\'t, nerd.'} - + {'Or don\'t, nerd.'} - - - ); -} - + + diff --git a/src/ui/game/component/GameFoe/index.tsx b/src/ui/game/component/GameFoe/index.tsx index ce270218..f27be834 100644 --- a/src/ui/game/component/GameFoe/index.tsx +++ b/src/ui/game/component/GameFoe/index.tsx @@ -6,6 +6,6 @@ import { Props } from './type'; export const GameFoe : RFC = ({ player, }) => - + {player.username} diff --git a/src/ui/game/screen/GameLobby/FoeList.tsx b/src/ui/game/screen/GameLobby/FoeList.tsx index e88a76b3..0f5de3c8 100644 --- a/src/ui/game/screen/GameLobby/FoeList.tsx +++ b/src/ui/game/screen/GameLobby/FoeList.tsx @@ -1,6 +1,8 @@ import { GameCardCentered, GameCardChildren } from "../../component/GameCard" import { CardColor } from '../../../../api/src/constant/card-color.enum'; +import { GameStack } from "../../component/GameStack"; import { GameText } from "../../component/GameText" +import { GameBox } from "../../component/GameBox"; import { GameFoe } from "../../component/GameFoe" import { FoeListProps } from "./type" import { List } from "@mantine/core" @@ -20,17 +22,21 @@ export const FoeList : RFC = ({ ) return ( - - - {'Other Players'} - - - {foes.map(player => ( - - - - ))} - + + + + + {'Other Players'} + + + {foes.map(player => ( + + + + ))} + + + ) }