Some checks failed
lotteryfront CI / build (push) Has been cancelled
- Updated `getPublicCurrencies` and `getPlayerAuthCaptcha` functions to include `skipGlobalServerError` option, improving error handling for API requests. - Refactored the NotFoundPage component to enhance mobile responsiveness and UI consistency, integrating `PlayerMobileViewport`. - Improved the NetworkStatusBanner and OfflineBanner components by adding player banner height reference for better layout management. - Updated Wallet components to utilize `PlayerMoneyDisplay` for consistent currency representation and added credit mode handling in various screens. - Enhanced the WalletScreen and Transfer screens with loading panels and credit guard logic for better user experience during wallet operations.
21 lines
635 B
TypeScript
21 lines
635 B
TypeScript
import { create } from "zustand";
|
|
|
|
export type PlayerTopBannerKind = "offline" | "network";
|
|
|
|
type PlayerTopBannerState = {
|
|
heights: Record<PlayerTopBannerKind, number>;
|
|
setBannerHeight: (kind: PlayerTopBannerKind, px: number) => void;
|
|
};
|
|
|
|
export const usePlayerTopBannerStore = create<PlayerTopBannerState>((set) => ({
|
|
heights: { offline: 0, network: 0 },
|
|
setBannerHeight: (kind, px) =>
|
|
set((state) => ({
|
|
heights: { ...state.heights, [kind]: Math.max(0, px) },
|
|
})),
|
|
}));
|
|
|
|
export function selectPlayerStickyTopOffset(state: PlayerTopBannerState): number {
|
|
return state.heights.offline + state.heights.network;
|
|
}
|