diff --git a/src/app/tools/statistics/page.tsx b/src/app/tools/statistics/page.tsx new file mode 100644 index 000000000..8c99e617b --- /dev/null +++ b/src/app/tools/statistics/page.tsx @@ -0,0 +1,16 @@ +import { Flex, Heading } from '@radix-ui/themes'; +import { HeroStat } from '../../../components/AllStatsOverview/components/HeroStat'; +import PageWrapper from '../../../components/PageWrapper'; + +export default function Page() { + return ( + + + TresAbhi + [OPTML] + + + + + ); +} diff --git a/src/components/AllStatsOverview/components/HeroStat/index.tsx b/src/components/AllStatsOverview/components/HeroStat/index.tsx index fcf527a33..7ade7f3bb 100644 --- a/src/components/AllStatsOverview/components/HeroStat/index.tsx +++ b/src/components/AllStatsOverview/components/HeroStat/index.tsx @@ -1,26 +1,13 @@ -import { Locale } from 'discord.js'; -import { Percentile } from '../../../../constants/percentiles'; -import { SupplementaryStats } from '../../../../core/blitz/getAccountInfo'; -import { translator } from '../../../../core/localization/translator'; -import getWN8Percentile from '../../../../core/statistics/getWN8Percentile'; import { theme } from '../../../../stitches.config'; -import { PERCENTILE_COLORS } from '../../../PercentileIndicator/constants'; import { Glow } from './components/Glow'; export interface WN8DisplayProps { - stats: SupplementaryStats; - locale: Locale; + subtitle: string; + color: string; + value: string | number; } -export function HeroStat({ stats, locale }: WN8DisplayProps) { - const { translate } = translator(locale); - - const percentile = - stats.WN8 === undefined ? Percentile.VeryBad : getWN8Percentile(stats.WN8); - const color = PERCENTILE_COLORS[percentile]; - const heroStat = stats.WN8 === undefined ? '--' : stats.WN8.toFixed(0); - const subtitle = translate(`common.wn8_percentile.${percentile}`); - +export function HeroStat({ color, subtitle, value }: WN8DisplayProps) { return (
- +
- {heroStat} + {value}
- +
); } diff --git a/src/components/AllStatsOverview/index.tsx b/src/components/AllStatsOverview/index.tsx index ef44798c8..8e87d2ff5 100644 --- a/src/components/AllStatsOverview/index.tsx +++ b/src/components/AllStatsOverview/index.tsx @@ -1,6 +1,9 @@ import { Locale } from 'discord.js'; +import { Percentile } from '../../constants/percentiles'; import { SupplementaryStats } from '../../core/blitz/getAccountInfo'; import { translator } from '../../core/localization/translator'; +import getWN8Percentile from '../../core/statistics/getWN8Percentile'; +import { PERCENTILE_COLORS } from '../PercentileIndicator/constants'; import { HeroStat } from './components/HeroStat'; import { WN8SurroundingStat, @@ -27,7 +30,16 @@ export default function AllStatsOverview({ locale, supplementaryStats, }: AllStatsOverviewProps) { - const { t } = translator(locale); + const { t, translate } = translator(locale); + const percentile = + supplementaryStats.WN8 === undefined + ? Percentile.VeryBad + : getWN8Percentile(supplementaryStats.WN8); + const color = PERCENTILE_COLORS[percentile]; + const heroStat = + supplementaryStats.WN8 === undefined + ? '--' + : supplementaryStats.WN8.toFixed(0); return (
- +