Public Access
feat(points): show early-since date in point texts
Refs #44. Core sends earlySince in the games and wallet responses. COMPLETION_TOO_OLD and the COMPLETED rule show it as {{date}}.
This commit is contained in:
1 parent
e044959629
commit
c966877b23
7 files changed
+62
-8
No files matched your search
@@ -15,7 +15,7 @@ import PageContainer from '../components/PageContainer.jsx';
|
||||
import {StatCount, StatDrillProvider, useDrillTarget} from '../components/stats/StatDrill.jsx';
|
||||
import {usePreferences} from '../context/PreferencesContext.jsx';
|
||||
import useInView from '../hooks/useInView.js';
|
||||
import {formatDate} from '../utils/format.js';
|
||||
import {formatDate, formatDay} from '../utils/format.js';
|
||||
import {buyItem, equipItem, LOOKS, SLOTS} from '../utils/rewards.js';
|
||||
|
||||
const GAME_KINDS = ['STARTED', 'FINISHED', 'FINISHED_MANUAL', 'FINISHED_EARLY', 'FINISHED_TOPUP', 'COMPLETED'];
|
||||
@@ -72,6 +72,8 @@ export default function PointsPage() {
|
||||
return null;
|
||||
};
|
||||
|
||||
const earlySince = wallet.earlySince && formatDay(wallet.earlySince, i18n.language, {dateStyle: 'medium'});
|
||||
|
||||
return (
|
||||
<StatDrillProvider source="points">
|
||||
<PageContainer className="p-4 md:p-8 space-y-6">
|
||||
@@ -86,7 +88,7 @@ export default function PointsPage() {
|
||||
<Card className="gap-2 p-5">
|
||||
<h2 className="font-semibold">{t('POINTS.HOW_TO')}</h2>
|
||||
<ul className="list-disc space-y-1 pl-5 text-sm text-muted-foreground">
|
||||
{HOW_TO.map((kind) => <li key={kind}>{t(`POINTS.RULES.${kind}`)}</li>)}
|
||||
{HOW_TO.map((kind) => <li key={kind}>{t(`POINTS.RULES.${kind}`, {date: earlySince})}</li>)}
|
||||
</ul>
|
||||
</Card>
|
||||
|
||||
|
||||
Reference in new issue
Block a user