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.
This commit is contained in:
@@ -24,11 +24,16 @@ import type { DrawCurrentPayload } from "@/types/api/draw-current";
|
|||||||
|
|
||||||
function ScheduleAnchorTime({ payload }: { payload: DrawCurrentPayload }) {
|
function ScheduleAnchorTime({ payload }: { payload: DrawCurrentPayload }) {
|
||||||
const { t } = useTranslation("player");
|
const { t } = useTranslation("player");
|
||||||
const useStart = payload.status === "pending" || payload.status === "open";
|
const isPending = payload.status === "pending";
|
||||||
const source = useStart
|
const isOpen = payload.status === "open";
|
||||||
|
const source = isPending
|
||||||
? payload.start_time ?? payload.close_time ?? payload.draw_time
|
? payload.start_time ?? payload.close_time ?? payload.draw_time
|
||||||
: payload.close_time ?? payload.draw_time ?? payload.start_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;
|
const formatted = source ? formatLotteryInstant(source) : null;
|
||||||
if (!formatted) {
|
if (!formatted) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
"currentIssue": "Current issue",
|
"currentIssue": "Current issue",
|
||||||
"currentTime": "Current Time",
|
"currentTime": "Current Time",
|
||||||
"scheduledStart": "Start time",
|
"scheduledStart": "Start time",
|
||||||
|
"scheduledEnd": "End time",
|
||||||
"scheduledClose": "Close time",
|
"scheduledClose": "Close time",
|
||||||
"startsIn": "Starts in",
|
"startsIn": "Starts in",
|
||||||
"scheduleNow": "Current time {{now}} ({{tz}})",
|
"scheduleNow": "Current time {{now}} ({{tz}})",
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
"currentIssue": "हालको इश्यू",
|
"currentIssue": "हालको इश्यू",
|
||||||
"currentTime": "हालको समय",
|
"currentTime": "हालको समय",
|
||||||
"scheduledStart": "सुरु समय",
|
"scheduledStart": "सुरु समय",
|
||||||
|
"scheduledEnd": "समाप्ति समय",
|
||||||
"scheduledClose": "बन्द समय",
|
"scheduledClose": "बन्द समय",
|
||||||
"startsIn": "सुरु हुन बाँकी",
|
"startsIn": "सुरु हुन बाँकी",
|
||||||
"scheduleNow": "हालको समय {{now}} ({{tz}})",
|
"scheduleNow": "हालको समय {{now}} ({{tz}})",
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
"currentIssue": "当前期号",
|
"currentIssue": "当前期号",
|
||||||
"currentTime": "当前时间",
|
"currentTime": "当前时间",
|
||||||
"scheduledStart": "开始时间",
|
"scheduledStart": "开始时间",
|
||||||
|
"scheduledEnd": "结束时间",
|
||||||
"scheduledClose": "封盘时间",
|
"scheduledClose": "封盘时间",
|
||||||
"startsIn": "距开始",
|
"startsIn": "距开始",
|
||||||
"scheduleNow": "当前时间 {{now}}({{tz}})",
|
"scheduleNow": "当前时间 {{now}}({{tz}})",
|
||||||
|
|||||||
Reference in New Issue
Block a user