Skip to content

Commit 550da07

Browse files
authored
Fix sidebar and charts (#175)
1 parent 3956777 commit 550da07

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/components/GameSidebar.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,14 @@ function GameSidebar({ game, scores, leaderboard, pause, endedAt }) {
129129
/>
130130
))}
131131
</List>
132-
<Divider style={{ margin: "8px 0" }} />
133-
<Typography variant="body2" align="center">
134-
<span style={{ fontWeight: 300 }}>
135-
{formatDateTime(game.startedAt)}
136-
</span>
137-
</Typography>
138132
</div>
133+
<Divider style={{ margin: "8px 0" }} />
134+
{/* Footer */}
135+
<Typography variant="body2" align="center">
136+
<span style={{ fontWeight: 300 }}>
137+
{formatDateTime(game.startedAt)}
138+
</span>
139+
</Typography>
139140
</Paper>
140141
);
141142
}

src/components/UserStatistics.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ArcElement, Chart as ChartJS } from "chart.js";
1+
import { ArcElement, Chart as ChartJS, Legend, Tooltip } from "chart.js";
22
import { memo } from "react";
33
import { Pie } from "react-chartjs-2";
44

@@ -8,7 +8,7 @@ import { makeStyles, useTheme } from "@material-ui/core/styles";
88

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

11-
ChartJS.register(ArcElement);
11+
ChartJS.register(ArcElement, Tooltip, Legend);
1212

1313
const useStyles = makeStyles((theme) => ({
1414
statisticsPanel: {
@@ -58,7 +58,7 @@ function UserStatistics({ stats, variant }) {
5858
plugins: {
5959
legend: {
6060
position: "bottom",
61-
onClick: (e) => e.stopPropagation(),
61+
onClick: () => {}, // disable click to show/hide category
6262
},
6363
tooltip: {
6464
enabled: num.finishedGames > 0,

src/pages/GamePage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ function GamePage({ match }) {
475475
</Box>
476476
<Box clone order={{ xs: 2, sm: 3 }}>
477477
<Grid item xs={12} md={3} className={classes.sideColumn}>
478-
<Box order={{ xs: 2, md: 1 }}>
478+
<Box order={{ xs: 2, md: 1 }} style={{ maxHeight: "100%" }}>
479479
<GameSidebar
480480
game={game}
481481
scores={scores}

0 commit comments

Comments
 (0)