diff --git a/web/src/pages/InboxPage.tsx b/web/src/pages/InboxPage.tsx index 6006f6a..828f680 100644 --- a/web/src/pages/InboxPage.tsx +++ b/web/src/pages/InboxPage.tsx @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from 'react'; import DOMPurify from 'dompurify'; -import { Copy, Inbox, RefreshCw, Search } from 'lucide-react'; +import { ArrowLeft, Copy, Inbox, RefreshCw, Search } from 'lucide-react'; import { toast } from 'sonner'; import { getJson, type MailDetail, type MailListResponse, type User } from '@/api'; import { CategoryBadge } from '@/components/CategoryBadge'; @@ -112,6 +112,8 @@ export function InboxPage({ user }: { user: User }): JSX.Element { const [isListLoading, setIsListLoading] = useState(true); const [listError, setListError] = useState(null); const [selectedMailId, setSelectedMailId] = useState(null); + // 移动端 ((null); const [isDetailLoading, setIsDetailLoading] = useState(false); @@ -170,7 +172,7 @@ export function InboxPage({ user }: { user: User }): JSX.Element { return (
- + @@ -256,7 +258,13 @@ export function InboxPage({ user }: { user: User }): JSX.Element { 'cursor-pointer bg-transparent transition-colors hover:bg-[#1a1a1a]', active && 'bg-[#252525]', )} - onClick={() => setSelectedMailId(item.id)} + onClick={() => { + setSelectedMailId(item.id); + setIsMobileDetailOpen(true); + if (!window.matchMedia('(min-width: 1024px)').matches) { + window.scrollTo({ top: 0 }); + } + }} >
{item.fromOrg || item.fromAddr || '-'}
@@ -294,9 +302,20 @@ export function InboxPage({ user }: { user: User }): JSX.Element {
- + - Mail Detail +
+ + Mail Detail +
{detailError ? ( @@ -315,8 +334,13 @@ export function InboxPage({ user }: { user: User }): JSX.Element { ) : detail ? ( <> -
-
From: {detail.fromOrg || detail.fromAddr || '-'}
+
+
+ From: {detail.fromOrg || detail.fromAddr || '-'} + {detail.fromOrg && detail.fromAddr ? ( + <{detail.fromAddr}> + ) : null} +
To:{' '} {detail.toAddr || '-'}