Skip to content

Commit

Permalink
fix card status, add white card to display
Browse files Browse the repository at this point in the history
  • Loading branch information
Techno11 committed Sep 25, 2024
1 parent 094259c commit eaa7174
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { FC, useMemo } from 'react';
import YELLOW_CARD from '../assets/penalty-yellow-card.png';
import RED_CARD from '../assets/penalty-red-card.png';
import WHITE_CARD from '../assets/penalty-white-card.png';
import styled from '@emotion/styled';
import { FeedingTheFuture } from '@toa-lib/models';

const Image = styled.img`
max-height: 100%;
Expand All @@ -11,12 +13,12 @@ const Image = styled.img`
export const CardStatus: FC<{ cardStatus: number }> = ({ cardStatus }) => {
const img = useMemo(() => {
switch (cardStatus) {
case 0:
return '';
case 1:
case FeedingTheFuture.CardStatus.YELLOW_CARD:
return YELLOW_CARD;
case 2:
case FeedingTheFuture.CardStatus.RED_CARD:
return RED_CARD;
case FeedingTheFuture.CardStatus.WHITE_CARD:
return WHITE_CARD;
default:
return '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const ScoreContainer = styled.div((props: { alliance: Alliance }) => ({
lineHeight: '5vh'
}));

export const MatchPlay: FC<DisplayProps> = ({ match }) => {
export const MatchPlay: FC<DisplayProps> = ({ match, teams }) => {
return (
<BGImage>
<Container spacing={5}>
Expand All @@ -93,13 +93,15 @@ export const MatchPlay: FC<DisplayProps> = ({ match }) => {
<AlliancePlay
alliance='red'
participants={match.participants ?? []}
teams={teams}
fullHeight
/>
<ScoreContainer alliance='red'>{match.redScore}</ScoreContainer>
<ScoreContainer alliance='blue'>{match.blueScore}</ScoreContainer>
<AlliancePlay
alliance='blue'
participants={match.participants ?? []}
teams={teams}
invert
fullHeight
/>
Expand Down

0 comments on commit eaa7174

Please sign in to comment.