Skip to content

Commit

Permalink
Merge pull request #100 from boostcampwm2023/feat/scoreboard/ui
Browse files Browse the repository at this point in the history
Feat/scoreboard/UI : ScoreBoard UI
  • Loading branch information
glowisn authored Nov 28, 2023
2 parents 986db77 + c2ceee5 commit e027ab1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
4 changes: 2 additions & 2 deletions client/src/components/ScoreBoardModal/Players.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { PlayerScoreType } from '../../types/ScoreType';
import { Result } from './Result';
import Result from './Result';

interface PlayersProps {
playerScore: PlayerScoreType;
}

export function Players({ playerScore }: PlayersProps) {
export default function Players({ playerScore }: PlayersProps) {
return (
<li className="flex flex-row gap-3 bg-aod_bg px-5 py-2.5 text-aod_text odd:bg-aod_text_alt odd:text-aod_gutter">
<div>{playerScore.name}</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ScoreBoardModal/Result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface ResultProps {
result: ResultType;
}

export function Result({ result }: ResultProps) {
export default function Result({ result }: ResultProps) {
return (
<div className="flex flex-1 flex-row justify-around">
{result === ResultType.CORRECT ? (
Expand Down
20 changes: 10 additions & 10 deletions client/src/components/ScoreBoardModal/ScoreBoard.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { ScoreType } from '../../types/ScoreType';
import { Players } from './Players';
import Players from './Players';

interface ScoreBoardProps {
scores: ScoreType;
scores: ScoreType;
}

export function ScoreBoard({ scores }: ScoreBoardProps) {
return (
<ul className="my-5 flex w-full flex-col overflow-auto text-sm font-medium text-aod_text">
{scores.players.map((playerScore, index) => (
<Players key={index} playerScore={playerScore} />
))}
</ul>
);
export default function ScoreBoard({ scores }: ScoreBoardProps) {
return (
<ul className="my-5 flex w-full flex-col overflow-auto text-sm font-medium text-aod_text">
{scores.players.map((playerScore, index) => (
<Players key={index} playerScore={playerScore} />
))}
</ul>
);
}
5 changes: 1 addition & 4 deletions client/src/components/ScoreBoardModal/ScoreBoardModal.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { ResultType, ScoreType } from '../../types/ScoreType';
import mockScoresData from '../../../public/mocks/Scores.json';
import { ScoreBoard } from './ScoreBoard';
import ScoreBoard from './ScoreBoard';
import { FaChartSimple } from 'react-icons/fa6';


const mockScores: ScoreType = {
players: mockScoresData.players.map((player) => ({
...player,
Expand All @@ -28,5 +27,3 @@ export default function ScoreBoardModal() {
</div>
);
}


6 changes: 0 additions & 6 deletions client/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Home from './pages/Home.tsx';
import NotFound from './pages/NotFound.tsx';
import Lobby from './pages/Lobby.tsx';
import Room from './pages/Room.tsx';
import ScoreBoardModal from './components/ScoreBoardModal/ScoreBoardModal.tsx';

export const router = createBrowserRouter([
{
Expand Down Expand Up @@ -35,11 +34,6 @@ export const router = createBrowserRouter([
</ProtectedRoute>
),
},
// ScoreBoardModal
{
path: '/scoreboard',
element: <ScoreBoardModal />,
},
],
},
]);

0 comments on commit e027ab1

Please sign in to comment.