feat: 增加 Jackpot 爆池实时弹层与奖池信息展示
This commit is contained in:
@@ -16,6 +16,7 @@ export function JackpotResultsStrip({
|
||||
}: JackpotResultsStripProps) {
|
||||
const { t } = useTranslation("player");
|
||||
const [minor, setMinor] = useState<number | null>(null);
|
||||
const [gap, setGap] = useState<number | null>(null);
|
||||
const [enabled, setEnabled] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -26,11 +27,13 @@ export function JackpotResultsStrip({
|
||||
if (!cancelled) {
|
||||
setEnabled(j.enabled);
|
||||
setMinor(j.current_amount_minor);
|
||||
setGap(j.draws_since_last_burst);
|
||||
}
|
||||
} catch {
|
||||
if (!cancelled) {
|
||||
setEnabled(false);
|
||||
setMinor(null);
|
||||
setGap(null);
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -51,6 +54,11 @@ export function JackpotResultsStrip({
|
||||
<p className="font-mono text-lg font-black tabular-nums text-[#0b3f96]">
|
||||
{formatMinorAsCurrency(minor, currencyCode.toUpperCase())}
|
||||
</p>
|
||||
{gap !== null ? (
|
||||
<p className="mt-1 text-xs font-semibold text-amber-800">
|
||||
{t("results.jackpotGap", { count: gap, defaultValue: "距上次爆池 {{count}} 期" })}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user