Skip to content

Commit

Permalink
Merge pull request #175 from daithihearn/ui-enhancements-5
Browse files Browse the repository at this point in the history
UI enhancements 5
  • Loading branch information
daithihearn authored Jul 6, 2023
2 parents f0bb7fe + 92cec0c commit 115eb0a
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "7.2.2",
"version": "7.2.3",
"description": "React frontend for the Cards 110",
"author": "Daithi Hearn",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"short_name": "Cards 110",
"name": "Cards 110",
"version": "7.2.2",
"version": "7.2.3",
"icons": [
{
"src": "./assets/favicon.png",
Expand Down
6 changes: 4 additions & 2 deletions src/components/Game/GameOver.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Card, CardContent, CardHeader, Grid } from "@mui/material"
import { Card, CardContent, CardHeader, Grid, Typography } from "@mui/material"

import Leaderboard from "components/Leaderboard/Leaderboard"
import Confetti from "react-confetti"
Expand All @@ -8,7 +8,9 @@ const GameOver = () => {
<Grid container justifyContent="center">
<Grid item>
<Card>
<CardHeader title="Game Over" />
<CardHeader
title={<Typography variant="h2">Game Over</Typography>}
/>
<CardContent>
<Leaderboard />
</CardContent>
Expand Down
5 changes: 4 additions & 1 deletion src/components/GameStats/GameStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Grid,
Switch,
FormControlLabel,
Typography,
} from "@mui/material"
import { useCallback, useEffect, useState } from "react"
import { useAppSelector } from "caches/hooks"
Expand All @@ -29,7 +30,9 @@ const GameStats = () => {
return (
<Grid container>
<MuiCard className="p-6 data-card">
<CardHeader title="Stats" />
<CardHeader
title={<Typography variant="h2">Stats</Typography>}
/>
<CardContent>
{myProfile.isAdmin ? (
<PlayerSwitcher onChange={setPlayer} />
Expand Down
9 changes: 8 additions & 1 deletion src/components/Header/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
Menu,
MenuItem,
Toolbar,
Typography,
} from "@mui/material"
import { getIsGameActive, getIamAdmin } from "caches/GameSlice"
import Leaderboard from "components/Leaderboard/Leaderboard"
Expand Down Expand Up @@ -156,7 +157,13 @@ const NavBar = () => {
onClose={toggleLeaderboardModal}>
<DialogContent>
<Card>
<CardHeader title="Leaderboard" />
<CardHeader
title={
<Typography variant="h2">
Leaderboard
</Typography>
}
/>
<CardContent>
<Leaderboard />
</CardContent>
Expand Down
5 changes: 4 additions & 1 deletion src/components/MyGames/MyGames.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
ListItemIcon,
ListItemSecondaryAction,
ListItemText,
Typography,
} from "@mui/material"

import moment from "moment"
Expand Down Expand Up @@ -65,7 +66,9 @@ const MyGames = () => {
<Grid container>
<Grid item xs={12}>
<Card>
<CardHeader title="Games" />
<CardHeader
title={<Typography variant="h2">Games</Typography>}
/>
<CardContent>
<List>
{last10Games.map(row => (
Expand Down
9 changes: 8 additions & 1 deletion src/components/StartNewGame/StartNewGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
TableContainer,
TableHead,
TableRow,
Typography,
useTheme,
} from "@mui/material"
import { useAppDispatch, useAppSelector } from "caches/hooks"
Expand Down Expand Up @@ -117,7 +118,13 @@ const StartNewGame = () => {
<Grid container>
<Grid item xs={12}>
<Card>
<CardHeader title="Start a new game" />
<CardHeader
title={
<Typography variant="h2">
Start a new game
</Typography>
}
/>
<CardContent>
<FormControl fullWidth>
<form onSubmit={startGame}>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useSnackbar } from "notistack"
import StatsService from "services/StatsService"
import parseError from "utils/ErrorUtils"
import SettingsService from "services/SettingsService"
import { Spa } from "@mui/icons-material"

const Home = () => {
const dispatch = useAppDispatch()
Expand Down Expand Up @@ -61,10 +62,11 @@ const Home = () => {
) : (
<div>
{myProfile.isPlayer ? (
<Grid container>
<Grid container sx={{ marginBottom: "10px" }}>
<MyGames />
</Grid>
) : null}

{myProfile.isPlayer && !myProfile.isAdmin ? (
<Grid container>
<GameStats />
Expand Down

0 comments on commit 115eb0a

Please sign in to comment.