Skip to content

Commit

Permalink
Fix table row heights and pie chart legend
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhang committed Dec 24, 2024
1 parent 6ea06c2 commit 5bb5ed3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/ProfileGamesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ function ProfileGamesTable({ userId, gamesWithScores, handleClickGame }) {
{game.scores &&
game.scores[userId] ===
Math.max(0, ...Object.values(game.scores)) && (
<StarIcon style={{ color: amber[500] }} />
<StarIcon
style={{ color: amber[500], marginBlock: -4 }}
/>
)}
</TableCell>
</TableRow>
Expand Down
12 changes: 9 additions & 3 deletions src/components/UserStatistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import Grid from "@mui/material/Grid";
import Typography from "@mui/material/Typography";
import { useTheme } from "@mui/material/styles";
import makeStyles from "@mui/styles/makeStyles";
import { ArcElement, Chart as ChartJS } from "chart.js";
import {
ArcElement,
Chart as ChartJS,
Legend,
PieController,
Tooltip,
} from "chart.js";
import { memo } from "react";
import { Pie } from "react-chartjs-2";

import { formatTime } from "../util";

ChartJS.register(ArcElement);
ChartJS.register(ArcElement, Legend, PieController, Tooltip);

const useStyles = makeStyles((theme) => ({
statisticsPanel: {
Expand Down Expand Up @@ -58,7 +64,7 @@ function UserStatistics({ stats, variant }) {
plugins: {
legend: {
position: "bottom",
onClick: (e) => e.stopPropagation(),
onClick: () => {}, // Disable click to show/hide category.
},
tooltip: {
enabled: num.finishedGames > 0,
Expand Down

0 comments on commit 5bb5ed3

Please sign in to comment.