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

@@ -12,6 +12,7 @@ import { useActivePlayerCurrency } from "@/hooks/use-active-player-currency";
import { PLAYER_CURRENCY_CHANGE_EVENT } from "@/lib/player-currency-preference";
import { isCreditFundingPlayer } from "@/lib/player-funding-mode";
import { formatWalletClientError } from "@/lib/wallet-api-error";
import { usePlayerSessionStore } from "@/stores/player-session-store";
import { getWalletLogsLastPage, type WalletLogsData } from "@/types/api/wallet-logs";
const WALLET_LOGS_PAGE_SIZE = 10;
@@ -25,7 +26,8 @@ export function WalletLogsScreen() {
const [logsLoading, setLogsLoading] = useState(false);
const [loadingMore, setLoadingMore] = useState(false);
const [error, setError] = useState<string | null>(null);
const [creditMode, setCreditMode] = useState(false);
const profile = usePlayerSessionStore((s) => s.profile);
const [creditMode, setCreditMode] = useState(() => isCreditFundingPlayer(profile));
const loadMoreRef = useRef<HTMLDivElement | null>(null);
const fetchPassRef = useRef(true);

View File

@@ -22,6 +22,7 @@ import { isCreditFundingPlayer } from "@/lib/player-funding-mode";
import { formatMinorAsCurrency } from "@/lib/money";
import { PLAYER_CURRENCY_CHANGE_EVENT } from "@/lib/player-currency-preference";
import { formatWalletClientError } from "@/lib/wallet-api-error";
import { usePlayerSessionStore } from "@/stores/player-session-store";
import type { WalletBalanceData } from "@/types/api/wallet-balance";
import { getWalletLogsLastPage, type WalletLogsData } from "@/types/api/wallet-logs";
@@ -163,7 +164,8 @@ export function WalletScreen() {
const hasMore = logs ? logs.page < getWalletLogsLastPage(logs) : false;
const isCreditPlayer = isCreditFundingPlayer(balance);
const profile = usePlayerSessionStore((s) => s.profile);
const isCreditPlayer = isCreditFundingPlayer(balance) || isCreditFundingPlayer(profile);
const displayMinor = isCreditPlayer
? Number(balance?.available_balance ?? 0)
: Number(balance?.balance ?? 0);