diff --git a/src/components/StatsDisplay/StatsDisplay.tsx b/src/components/StatsDisplay/StatsDisplay.tsx index 2e81a83..86bdf9d 100644 --- a/src/components/StatsDisplay/StatsDisplay.tsx +++ b/src/components/StatsDisplay/StatsDisplay.tsx @@ -1,7 +1,5 @@ -import classNames from 'classnames' import { useEffect, useState } from 'react' -import styles from './StatsDisplay.module.scss' import { AllStats, SingleStats } from 'src/hooks/useStats' import { CaretUpIcon, CaretDownIcon } from 'src/components/Icons/icons' @@ -13,24 +11,24 @@ const SingleStatsDisplay: React.FC = ({ stats }: SingleProps) => { const winPercentage = stats ? (stats.gamesWon / stats.gamesPlayed) * 100 : 0 return ( -
-
-
+
+
+
{stats?.gamesWon || 0}
-
Correct
+
Correct
-
-
+
+
{stats?.gamesPlayed || 0}
-
Played
+
Played
-
-
+
+
{Number.isNaN(winPercentage) ? '-' : Math.trunc(winPercentage)}%
-
Rate
+
Rate
) @@ -47,8 +45,18 @@ const RatingDiffDisplay: React.FC = ({ const sign = diff < 0 ? '–' : '+' return ( -
- {icon} {sign + Math.abs(diff)} +
+ + {icon} + +

+ {sign} + {Math.abs(diff)} +

) } @@ -72,14 +80,11 @@ export const StatsDisplay: React.FC = ({ }, [stats]) return ( -
-
-
Your rating
+
+
+
Your rating
{cachedRating || 0} {stats.rating != undefined && stats.lastRating != undefined ? ( @@ -88,13 +93,13 @@ export const StatsDisplay: React.FC = ({
{hideSession ? null : ( -
-
This session
+
+
This session
)} -
-
Lifetime
+
+
Lifetime