diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 0bd9b78..61a89dd 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -98,6 +98,9 @@ "account_info": "Account Information", "username": "Username", "email": "Email", + "change_email": "Change email", + "change_email_subject": "Request to change Pushy account email", + "change_email_body": "Current account email: {{email}}\n\nPlease describe the new email address you want to use and include any required identity verification details.", "service_version": "Plan", "service_expire": "Expires", "no_expire": "None", diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index 4192145..eb5ccd9 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -98,6 +98,9 @@ "account_info": "账户信息", "username": "用户名", "email": "邮箱", + "change_email": "修改邮箱", + "change_email_subject": "申请修改 Pushy 账户邮箱", + "change_email_body": "当前账户邮箱:{{email}}\n\n请说明需要修改为的新邮箱,并附上必要的身份验证信息。", "service_version": "服务版本", "service_expire": "服务有效期至", "no_expire": "无", diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx index e2877b4..819be29 100644 --- a/src/pages/user/index.tsx +++ b/src/pages/user/index.tsx @@ -1,6 +1,14 @@ import { LogoutOutlined } from '@ant-design/icons'; import { useQueries, useQuery } from '@tanstack/react-query'; -import { Button, Descriptions, Grid, message, Popover, Spin } from 'antd'; +import { + Button, + Descriptions, + Grid, + message, + Popover, + Space, + Spin, +} from 'antd'; import { useTranslation } from 'react-i18next'; import { api } from '@/services/api'; import { logout } from '@/services/auth'; @@ -14,11 +22,13 @@ import { } from './purchase-controls'; import { QuotaDetailsPanel, type QuotaUsageRow } from './quota-details'; +const SUPPORT_EMAIL = 'hi@charmlot.com'; + const getInvoiceHint = (t: (key: string) => string) => (
{t('user.invoice_hint_before_email')} - hi@charmlot.com + {SUPPORT_EMAIL} {t('user.invoice_hint_after_email')}
@@ -72,6 +82,9 @@ function UserPanel() {
);
}
const { name, email, tier, quota } = user;
+ const changeEmailHref = `mailto:${SUPPORT_EMAIL}?subject=${encodeURIComponent(
+ t('user.change_email_subject'),
+ )}&body=${encodeURIComponent(t('user.change_email_body', { email }))}`;
const defaultQuota = quotas[tier as keyof typeof quotas];
const currentQuota = quota || defaultQuota;
@@ -178,7 +191,12 @@ function UserPanel() {
>