diff --git a/ui/src/components/display-card.tsx b/ui/src/components/display-card.tsx index 8ecd72b..229625b 100644 --- a/ui/src/components/display-card.tsx +++ b/ui/src/components/display-card.tsx @@ -21,7 +21,7 @@ import { isLive, timeUntilGame } from '~/lib/utils.ts'; const logos = import.meta.glob('../assets/teams/*.svg', { eager: true }); const getLogo = (team: string) => { - let strIndex = `../assets/teams/${team}.svg` + let strIndex = `../assets/teams/${team}.svg`; // @ts-ignore return logos[strIndex].default; }; @@ -43,7 +43,6 @@ const formattedTimeForUser = (time: number): string => { }; - const getColorFromStatusAndOutcome = ( status: string, winner: boolean, @@ -57,7 +56,7 @@ const getColorFromStatusAndOutcome = ( } else { return 'bg-yellow-600'; } -} +}; const winningTeam = (game: GameWithPrediction): number => { @@ -78,7 +77,7 @@ interface ITeamProps { interface ITeamInfoProps { team: Team; winner: number; - prediction?: Prediction + prediction?: Prediction; game: GameWithPrediction; } @@ -92,15 +91,18 @@ export const ScoreTable: Component = (props: ITeamProps) => { }; return ( - - +
+ - {(period, _) => {formatPeriodType(period)}} + {(period, _) => {formatPeriodType(period)}} - + - {(period, _) => {period.score}} + {(period, _) => {period.score === null || period.score === 0 ? '-' : period.score + }}
@@ -109,36 +111,37 @@ export const ScoreTable: Component = (props: ITeamProps) => { export const KeyPlayer: Component = (props: ITeamProps) => { return ( -
-

Key Player - {props.team.name}

+
+

Key Player - {props.team.name}

{props.team.leader.name}

-

Points: {props.team.leader.points}

-

Rebounds: {props.team.leader.rebounds}

-

Assists: {props.team.leader.assists}

+

Points: {props.team.leader.points}

+

Rebounds: {props.team.leader.rebounds}

+

Assists: {props.team.leader.assists}

); }; export const TeamInfo: Component = (props: ITeamInfoProps) => { return ( -
- +
+ - {`${props.team.city} ${props.team.name}`} - + {`${props.team.city} ${props.team.name}`} + {`${props.team.wins} - ${props.team.losses}`} - + - Winner + Winner - + Projected Winner @@ -155,8 +158,8 @@ export const AdvancedGameCard: Component = (props: ITeamProps) => {
- ) -} + ); +}; export const DemoCard: Component = (props: IDisplayCard) => { const [injuryReportOpen, setInjuryReportOpen] = createSignal(false); @@ -166,28 +169,31 @@ export const DemoCard: Component = (props: IDisplayCard) => { class='w-full max-w-4xl mx-auto bg-shark-900 rounded-lg shadow-md overflow-hidden p-4 text-white border-4 border-shark-700'>
- - vs - + + vs +
- -
+ +
-
- - {`${props.game.location.name}, ${props.game.location.city}, ${props.game.location.state}`} +
+ + {`${props.game.location.name}, ${props.game.location.city}, ${props.game.location.state}`}
-
- - +
+ + -

Postponed

+

Postponed

- + {formattedTimeForUser(props.game.start_time_unix)} @@ -200,7 +206,7 @@ export const DemoCard: Component = (props: IDisplayCard) => {
-
+
{(team, _) => ( @@ -209,22 +215,29 @@ export const DemoCard: Component = (props: IDisplayCard) => { )} -
-
-
+
+
+
- + - Live + Live
-

- {`${props.game.home_team.name}: ${props.game.home_team.score.points}`} - - - {`${props.game.away_team.name}: ${props.game.away_team.score.points}`} -

-

{props.game.status.includes('ET') ? 'Starting soon!' : props.game.status}

+
+
+

{props.game.home_team.name}

+

{props.game.home_team.score.points}

+
+ - +
+

{props.game.away_team.name}

+

{props.game.away_team.score.points}

+
+
+

{props.game.status.includes('ET') ? 'Starting soon!' : props.game.status}

@@ -235,36 +248,35 @@ export const DemoCard: Component = (props: IDisplayCard) => {
- + team.injuries.length > 0)}> -