From 81870bd01055818e21ff7f389e45b7e2772060d7 Mon Sep 17 00:00:00 2001 From: kang Date: Mon, 25 May 2026 18:04:35 +0800 Subject: [PATCH] feat: update draw scheduling logic and add new translation keys - Refactored HallDrawPanel to improve the logic for determining scheduled start and end times. - Introduced a new translation key for "scheduledEnd" in English, Nepali, and Chinese to support enhanced scheduling features. - Improved user experience by clearly differentiating between scheduled start, end, and close times. --- src/features/hall/hall-draw-panel.tsx | 11 ++++++++--- src/i18n/locales/en/player.json | 1 + src/i18n/locales/ne/player.json | 1 + src/i18n/locales/zh/player.json | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/features/hall/hall-draw-panel.tsx b/src/features/hall/hall-draw-panel.tsx index 81b9cdd..46a0179 100644 --- a/src/features/hall/hall-draw-panel.tsx +++ b/src/features/hall/hall-draw-panel.tsx @@ -24,11 +24,16 @@ import type { DrawCurrentPayload } from "@/types/api/draw-current"; function ScheduleAnchorTime({ payload }: { payload: DrawCurrentPayload }) { const { t } = useTranslation("player"); - const useStart = payload.status === "pending" || payload.status === "open"; - const source = useStart + const isPending = payload.status === "pending"; + const isOpen = payload.status === "open"; + const source = isPending ? payload.start_time ?? payload.close_time ?? payload.draw_time : payload.close_time ?? payload.draw_time ?? payload.start_time; - const labelKey = useStart ? "draw.scheduledStart" : "draw.scheduledClose"; + const labelKey = isPending + ? "draw.scheduledStart" + : isOpen + ? "draw.scheduledEnd" + : "draw.scheduledClose"; const formatted = source ? formatLotteryInstant(source) : null; if (!formatted) { return ( diff --git a/src/i18n/locales/en/player.json b/src/i18n/locales/en/player.json index f2306f8..c23f434 100644 --- a/src/i18n/locales/en/player.json +++ b/src/i18n/locales/en/player.json @@ -74,6 +74,7 @@ "currentIssue": "Current issue", "currentTime": "Current Time", "scheduledStart": "Start time", + "scheduledEnd": "End time", "scheduledClose": "Close time", "startsIn": "Starts in", "scheduleNow": "Current time {{now}} ({{tz}})", diff --git a/src/i18n/locales/ne/player.json b/src/i18n/locales/ne/player.json index 24ec272..9c51dbf 100644 --- a/src/i18n/locales/ne/player.json +++ b/src/i18n/locales/ne/player.json @@ -74,6 +74,7 @@ "currentIssue": "हालको इश्यू", "currentTime": "हालको समय", "scheduledStart": "सुरु समय", + "scheduledEnd": "समाप्ति समय", "scheduledClose": "बन्द समय", "startsIn": "सुरु हुन बाँकी", "scheduleNow": "हालको समय {{now}} ({{tz}})", diff --git a/src/i18n/locales/zh/player.json b/src/i18n/locales/zh/player.json index b831f74..9253529 100644 --- a/src/i18n/locales/zh/player.json +++ b/src/i18n/locales/zh/player.json @@ -74,6 +74,7 @@ "currentIssue": "当前期号", "currentTime": "当前时间", "scheduledStart": "开始时间", + "scheduledEnd": "结束时间", "scheduledClose": "封盘时间", "startsIn": "距开始", "scheduleNow": "当前时间 {{now}}({{tz}})",