feat: refine wallet credit mode detection and improve UI consistency across multiple screens
Some checks failed
lotteryfront CI / build (push) Has been cancelled

- Updated wallet screens to check both balance and profile for credit funding mode, ensuring consistent credit player detection
- Removed currency switcher from hall header and schedule timezone display from draw panel for cleaner UI
- Simplified ticket orders status filter to single-select mode with improved visual hierarchy
- Added sizes="100vw" attribute to entry and login background images for proper
This commit is contained in:
2026-06-24 14:35:59 +08:00
parent cff6470031
commit 4d24906d45
8 changed files with 34 additions and 60 deletions

View File

@@ -13,12 +13,7 @@ import {
} from "@/features/draw/draw-status-meta";
import type { HallDrawLiveSnapshot } from "@/features/hall/use-hall-draw-live";
import { formatSecondsClock } from "@/lib/format-gmt";
import { LOTTERY_SCHEDULE_TIMEZONE } from "@/lib/lottery-schedule-timezone";
import {
formatPlayerInstant,
formatLotteryScheduleClock,
getBrowserTimeZoneLabel,
} from "@/lib/player-datetime";
import { formatPlayerInstant } from "@/lib/player-datetime";
import { cn } from "@/lib/utils";
import type { DrawCurrentPayload } from "@/types/api/draw-current";
@@ -190,7 +185,7 @@ export function HallDrawPanel({ drawLive }: { drawLive: HallDrawLiveSnapshot })
<div className="flex min-w-0 flex-col items-center justify-center px-2 py-3 text-center">
<div className="min-w-0 max-w-full overflow-x-auto">
<p className="text-[11px] font-semibold text-slate-500">{t("draw.issueNo")}</p>
<p className="whitespace-nowrap text-sm font-black tabular-nums text-[#ff143d]">
<p className="whitespace-nowrap text-xs font-black tabular-nums text-[#ff143d] sm:text-sm">
{display.draw_no}
</p>
</div>
@@ -214,17 +209,6 @@ export function HallDrawPanel({ drawLive }: { drawLive: HallDrawLiveSnapshot })
/>
</div>
</div>
{display.schedule_now ? (
<div className="border-t border-[#eef3f9] bg-[#fbfdff] px-3 py-1.5 text-center text-[11px] text-slate-500">
{t("draw.scheduleNow", {
now: formatLotteryScheduleClock(
display.schedule_now,
display.schedule_timezone ?? LOTTERY_SCHEDULE_TIMEZONE,
),
tz: getBrowserTimeZoneLabel(),
})}
</div>
) : null}
{blockedUi ? (
<div className="flex items-center gap-2 border-t border-red-100 bg-red-50 px-3 py-2 text-xs font-medium text-red-600">
<TimerReset className="size-4 shrink-0" aria-hidden />

View File

@@ -5,7 +5,6 @@ import Image from "next/image";
import Link from "next/link";
import { useTranslation } from "react-i18next";
import { CurrencySwitcher } from "@/components/currency-switcher";
import { LanguageSwitcher } from "@/components/language-switcher";
import { HallBettingGrid } from "@/features/hall/hall-betting-grid";
import { usePlayerStickyTopStyle } from "@/hooks/use-player-sticky-top-style";
@@ -35,7 +34,7 @@ export function HallScreen() {
<header
className={cn(
playerPageHeader,
"sticky z-20 mb-2 flex min-h-9 items-center gap-2 overflow-visible bg-white/95 pt-2 pb-2 -mx-3 px-3 backdrop-blur",
"sticky z-20 mb-2 flex min-h-9 items-center gap-2 overflow-visible bg-white pt-2 pb-2 -mx-3 px-3",
)}
style={stickyTopStyle}
>
@@ -50,15 +49,6 @@ export function HallScreen() {
/>
</div>
<div className="flex shrink-0 items-center gap-1">
<CurrencySwitcher
variant="minimal"
menuAlign="end"
showLabel
className={cn(
playerHeaderControl,
"rounded-full border border-[#e4eaf4] bg-[#f8fafc] [&_button]:h-8 [&_button]:gap-1 [&_button]:px-2 [&_button]:py-0 [&_button]:text-xs [&_button]:font-bold [&_button]:text-[#0b3f96]",
)}
/>
<LanguageSwitcher
variant="minimal"
menuAlign="end"

View File

@@ -20,6 +20,7 @@ import { isCreditFundingPlayer } from "@/lib/player-funding-mode";
import { PLAYER_CURRENCY_CHANGE_EVENT } from "@/lib/player-currency-preference";
import { cn } from "@/lib/utils";
import { useNetworkConnectionStore } from "@/stores/network-connection-store";
import { usePlayerSessionStore } from "@/stores/player-session-store";
const BALANCE_KEY = (currency: string) => ["wallet/balance", currency];
@@ -62,7 +63,8 @@ export function HallWalletStrip() {
}, [isDegraded]);
const availableMinor = Number(balance?.available_balance ?? balance?.balance ?? 0);
const isCreditPlayer = isCreditFundingPlayer(balance);
const profile = usePlayerSessionStore((s) => s.profile);
const isCreditPlayer = isCreditFundingPlayer(balance) || isCreditFundingPlayer(profile);
const balanceMinor = Number(balance?.balance ?? 0);
const headlineMinor = isCreditPlayer ? availableMinor : balanceMinor;
const transferInLotteryMinor = isCreditPlayer ? availableMinor : balanceMinor;