From 52702c9fbb4705ba2d19e614643bf8c26539becc Mon Sep 17 00:00:00 2001 From: kang Date: Fri, 22 May 2026 16:11:58 +0800 Subject: [PATCH] feat: integrate public settings into Play Rules screen and update button properties - Added functionality to fetch and display dynamic rules content in the Play Rules screen. - Updated button components in HallBetResultDialog and WinningResultDialog to include nativeButton property for improved behavior. --- src/api/index.ts | 1 + src/api/settings.ts | 19 ++ src/features/hall/hall-bet-result-dialog.tsx | 1 + src/features/results/check-winning-screen.tsx | 1 + src/features/rules/play-rules-screen.tsx | 203 ++++-------------- 5 files changed, 58 insertions(+), 167 deletions(-) create mode 100644 src/api/settings.ts diff --git a/src/api/index.ts b/src/api/index.ts index 91dbad6..7861907 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -22,3 +22,4 @@ export { type WalletTransferBody, type WalletTransferResultData, } from "@/api/wallet"; +export { getPublicSettings, type SettingItem, type SettingListResponse } from "@/api/settings"; diff --git a/src/api/settings.ts b/src/api/settings.ts new file mode 100644 index 0000000..bae4078 --- /dev/null +++ b/src/api/settings.ts @@ -0,0 +1,19 @@ +import { lotteryRequest } from "@/lib/lottery-http"; +import { API_V1_PREFIX } from "@/api/paths"; + +export type SettingItem = { + key: string; + value: unknown; + group: string; + description: string | null; +}; + +export type SettingListResponse = { + items: SettingItem[]; +}; + +export async function getPublicSettings(group: string): Promise { + return lotteryRequest.get(`${API_V1_PREFIX}/settings`, { + params: { group }, + }); +} diff --git a/src/features/hall/hall-bet-result-dialog.tsx b/src/features/hall/hall-bet-result-dialog.tsx index 7929eaf..830f174 100644 --- a/src/features/hall/hall-bet-result-dialog.tsx +++ b/src/features/hall/hall-bet-result-dialog.tsx @@ -210,6 +210,7 @@ export function HallBetResultDialog({