diff --git a/src/features/wallet/wallet-transfer-dialogs.tsx b/src/features/wallet/wallet-transfer-dialogs.tsx index e8a9c35..0ff7402 100644 --- a/src/features/wallet/wallet-transfer-dialogs.tsx +++ b/src/features/wallet/wallet-transfer-dialogs.tsx @@ -25,15 +25,6 @@ type BaseProps = { idPrefix?: string; }; -const defaultInTrigger = - "!bg-[#0b3f96] !text-white shadow-[0_8px_18px_rgba(11,63,150,0.18)] hover:!bg-[#08357f]"; -const defaultOutTrigger = "flex-1"; - -const hallInTrigger = - "rounded-2xl border border-[#d7e5fb] !bg-[#0b3f96] !text-white shadow-[0_10px_24px_rgba(11,63,150,0.22)] hover:!bg-[#08357f]"; -const hallOutTrigger = - "rounded-2xl border border-[#ffc7d2] !bg-white !text-[#e5002c] shadow-[0_8px_22px_rgba(216,20,53,0.08)] hover:!bg-[#fff5f7]"; - export function TransferInDialog({ currency, lotteryMinor, @@ -52,31 +43,29 @@ export function TransferInDialog({ const { t } = useTranslation("player"); const resolvedTriggerLabel = triggerLabel ?? t("wallet.transferIn"); - const triggerCombined = cn( - "inline-flex h-10 min-h-10 w-full min-w-0 flex-1 items-center justify-center gap-1.5 px-3 text-sm font-medium", - triggerVariant === "hall" ? hallInTrigger : defaultInTrigger, - triggerClassName, - ); - return ( - - - {t("wallet.transferInTitle")} - + + + {t("wallet.transferInTitle")} + {t("wallet.dialogInDescription", { currency })} -
+
- - - {t("wallet.transferOutTitle")} - + + + {t("wallet.transferOutTitle")} + {t("wallet.dialogOutDescription")} -
+
+ {children} +
+ ); +} + +function TransferPreview({ children }: { children: ReactNode }) { + return ( +

{children}

+ ); +} + +function TransferError({ message }: { message: string }) { + return ( +

+ {message} +

+ ); +} + +function TransferDialogFooter({ + submitting, + confirmLabel, + onConfirm, + onCancel, +}: { + submitting: boolean; + confirmLabel: string; + onConfirm: () => void; + onCancel: () => void; +}) { + const { t } = useTranslation("player"); + + return ( +
+ + +
+ ); +} + /** 弹窗内:取消关闭;独立页:仅展示提交(返回用顶栏或上方链接) */ export function TransferInPanel({ currency, @@ -113,7 +180,8 @@ export function TransferInPanel({ variant === "page" ? ( ) : ( -
- - -
+ void submit()} + onCancel={onCancel} + /> ); return ( <> -
-
-

+

+ +

{t("wallet.mainBalance")}{" "} - {t("wallet.mainPending")} + {t("wallet.mainPending")}

-

+

{t("wallet.lotteryBalance")}{" "} - + {formatMinorAsCurrency(lotteryMinor, currency)}

-
-
- + +
+ setAmountText(ev.target.value)} disabled={submitting} autoComplete="off" - className="h-13 rounded-2xl border-[#d7e5fb] bg-white px-4 text-lg font-bold tabular-nums text-[#101a33] shadow-inner focus-visible:ring-[#0b3f96]/20" + className="h-11 text-base tabular-nums" /> -

+ {t("wallet.afterInPreview", { amount: formatMinorAsCurrency(previewAfter, currency), })} -

+
- {localError ? ( -

{localError}

- ) : null} + {localError ? : null}
{footer} @@ -266,7 +312,8 @@ export function TransferOutPanel({ variant === "page" ? ( ) : ( -
- - -
+ void submit()} + onCancel={onCancel} + /> ); return ( <> -
-
-

+

+ +

{t("wallet.lotteryAvailable")}{" "} - + {formatMinorAsCurrency(availableMinor, currency)}

-
-
-
- + +
+
+
- {localError ? ( -

{localError}

- ) : null} + {localError ? : null}
{footer} @@ -375,12 +400,10 @@ export function TransferInPage({ backHref="/wallet" backLabel={t("wallet.title")} > - + - {t("wallet.transferInTitle")} - - {t("wallet.transferInDescription")} - + {t("wallet.transferInTitle")} + {t("wallet.transferInDescription")} - + - {t("wallet.transferOutTitle")} - - {t("wallet.transferOutDescription")} - + {t("wallet.transferOutTitle")} + {t("wallet.transferOutDescription")}