fix: unify empty mailbox management action
This commit is contained in:
@@ -181,7 +181,7 @@ const exactTranslations: Record<string, Translation> = {
|
|||||||
"还没有可用邮箱": { "zh-TW": "還沒有可用信箱", en: "No mailbox available" },
|
"还没有可用邮箱": { "zh-TW": "還沒有可用信箱", en: "No mailbox available" },
|
||||||
"请在个人中心申请邮箱,或联系管理员为当前账号分配邮箱。": { "zh-TW": "請在個人中心申請信箱,或聯絡管理員為目前帳號分配信箱。", en: "Apply for a mailbox in Profile, or contact an administrator to assign one to this account." },
|
"请在个人中心申请邮箱,或联系管理员为当前账号分配邮箱。": { "zh-TW": "請在個人中心申請信箱,或聯絡管理員為目前帳號分配信箱。", en: "Apply for a mailbox in Profile, or contact an administrator to assign one to this account." },
|
||||||
"前往个人中心": { "zh-TW": "前往個人中心", en: "Go to profile" },
|
"前往个人中心": { "zh-TW": "前往個人中心", en: "Go to profile" },
|
||||||
"请前往邮箱管理,为当前账号创建或分配邮箱。": { "zh-TW": "請前往信箱管理,為目前帳號建立或分配信箱。", en: "Open mailbox management to create or assign a mailbox to this account." },
|
"请前往邮箱管理,创建、申请或联系管理员分配邮箱。": { "zh-TW": "請前往信箱管理,建立、申請或聯絡管理員分配信箱。", en: "Open mailbox management to create, request, or ask an administrator to assign a mailbox." },
|
||||||
"前往邮箱管理": { "zh-TW": "前往信箱管理", en: "Go to mailbox management" },
|
"前往邮箱管理": { "zh-TW": "前往信箱管理", en: "Go to mailbox management" },
|
||||||
"无邮箱前台权限": { "zh-TW": "無信箱前台權限", en: "No mailbox access" },
|
"无邮箱前台权限": { "zh-TW": "無信箱前台權限", en: "No mailbox access" },
|
||||||
"当前账号未开启邮箱前台访问权限。": { "zh-TW": "目前帳號未開啟信箱前台存取權限。", en: "Mailbox access is not enabled for this account." },
|
"当前账号未开启邮箱前台访问权限。": { "zh-TW": "目前帳號未開啟信箱前台存取權限。", en: "Mailbox access is not enabled for this account." },
|
||||||
|
|||||||
@@ -1469,7 +1469,7 @@ export function MailPage() {
|
|||||||
) : !canReadMail ? (
|
) : !canReadMail ? (
|
||||||
<PermissionEmptyState title="无邮件查看权限" description="当前账号可以访问邮箱前台,但未开启邮件查看权限。" onOpenSettings={openSettings} />
|
<PermissionEmptyState title="无邮件查看权限" description="当前账号可以访问邮箱前台,但未开启邮件查看权限。" onOpenSettings={openSettings} />
|
||||||
) : !mailboxList.isLoading && !hasMailboxes && mailView !== "unknown" ? (
|
) : !mailboxList.isLoading && !hasMailboxes && mailView !== "unknown" ? (
|
||||||
<NoMailboxState canManageMailboxes={canManageMailboxes} onOpenSettings={openSettings} onManageMailboxes={() => navigate("/admin?section=mailboxes")} />
|
<NoMailboxState onManageMailboxes={() => navigate(canManageMailboxes ? "/admin?section=mailboxes" : "/profile?tab=mailboxes")} />
|
||||||
) : mailView === "scheduled" && canScheduleMail ? (
|
) : mailView === "scheduled" && canScheduleMail ? (
|
||||||
<ScheduledSendView
|
<ScheduledSendView
|
||||||
compact={compactMailLayout}
|
compact={compactMailLayout}
|
||||||
@@ -2062,7 +2062,7 @@ function externalAccountSubtitle(account: ExternalImapAccount) {
|
|||||||
return [name, account.host, mode].filter(Boolean).join(" · ")
|
return [name, account.host, mode].filter(Boolean).join(" · ")
|
||||||
}
|
}
|
||||||
|
|
||||||
function NoMailboxState({ canManageMailboxes, onOpenSettings, onManageMailboxes }: { canManageMailboxes: boolean; onOpenSettings: () => void; onManageMailboxes: () => void }) {
|
function NoMailboxState({ onManageMailboxes }: { onManageMailboxes: () => void }) {
|
||||||
return (
|
return (
|
||||||
<div className="grid min-h-0 flex-1 place-items-center p-6">
|
<div className="grid min-h-0 flex-1 place-items-center p-6">
|
||||||
<div className="w-full max-w-md rounded-lg border border-dashed p-8 text-center">
|
<div className="w-full max-w-md rounded-lg border border-dashed p-8 text-center">
|
||||||
@@ -2070,10 +2070,9 @@ function NoMailboxState({ canManageMailboxes, onOpenSettings, onManageMailboxes
|
|||||||
<Mail className="h-5 w-5 text-muted-foreground" />
|
<Mail className="h-5 w-5 text-muted-foreground" />
|
||||||
</div>
|
</div>
|
||||||
<div className="text-lg font-semibold">还没有可用邮箱</div>
|
<div className="text-lg font-semibold">还没有可用邮箱</div>
|
||||||
<div className="mt-2 text-sm text-muted-foreground">{canManageMailboxes ? "请前往邮箱管理,为当前账号创建或分配邮箱。" : "请在个人中心申请邮箱,或联系管理员为当前账号分配邮箱。"}</div>
|
<div className="mt-2 text-sm text-muted-foreground">请前往邮箱管理,创建、申请或联系管理员分配邮箱。</div>
|
||||||
<Button className="mt-5" onClick={canManageMailboxes ? onManageMailboxes : onOpenSettings}>
|
<Button className="mt-5" onClick={onManageMailboxes}>
|
||||||
{canManageMailboxes ? <MailboxIcon className="h-4 w-4" /> : <Settings className="h-4 w-4" />}
|
<MailboxIcon className="h-4 w-4" />前往邮箱管理
|
||||||
{canManageMailboxes ? "前往邮箱管理" : "前往个人中心"}
|
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user