feat: animate user profile transitions

This commit is contained in:
lezi-fun committed 2026-08-12 10:24:20 +08:00
1 parent 8e67e82eb0
commit bbf3262aff
6 files changed
+467 -63

No files matched your search

+2 -2
View File
@@ -18,7 +18,7 @@ import Modals from '@/components/Modals';
import LoadingScreen from '@/components/LoadingScreen';
function HomeInner() {
const { view, currentPostId, currentPostPreview, currentUsername, currentPageName, ready, forumName, forumNameLoaded } = useApp();
const { view, currentPostId, currentPostPreview, currentUsername, currentUserPreview, currentPageName, ready, forumName, forumNameLoaded } = useApp();
const [modal, setModal] = useState(null); // null | login | register | report
const [reportPostId, setReportPostId] = useState(null);
@@ -42,7 +42,7 @@ function HomeInner() {
{/* 独立页面 */}
<div style={{ display: view !== 'feed' ? 'block' : 'none' }}>
{view === 'post' && currentPostId && <PostDetail postId={currentPostId} initialPost={currentPostPreview} />}
{view === 'user' && currentUsername && <UserProfile username={currentUsername} />}
{view === 'user' && currentUsername && <UserProfile username={currentUsername} initialUser={currentUserPreview} />}
{view === 'custom' && currentPageName && <CustomPage pageName={currentPageName} />}
{view === 'new' && <NewPost />}
{view === 'admin' && <AdminPage />}