ui enhancements
This commit is contained in:
+7
-2
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import {
|
||||
AtSign,
|
||||
Bookmark,
|
||||
@@ -30,6 +30,11 @@ export default function MeLayout({ children }: { children: React.ReactNode }) {
|
||||
const { user, loading } = useAuth();
|
||||
const { requireAuth } = useAuthGate();
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
// /u/me?edit=1 swaps the Posts grid for the inline edit form (see
|
||||
// app/u/me/page.tsx). The tab strip would just be in the way while the
|
||||
// user is editing — hide it for that one URL state.
|
||||
const editMode = searchParams.get("edit") === "1";
|
||||
|
||||
useEffect(() => {
|
||||
if (loading || user) return;
|
||||
@@ -86,7 +91,7 @@ export default function MeLayout({ children }: { children: React.ReactNode }) {
|
||||
joinedAt={user.created_at}
|
||||
editHref="/u/me?edit=1"
|
||||
/>
|
||||
<ProfileTabs tabs={tabs} />
|
||||
{editMode ? null : <ProfileTabs tabs={tabs} />}
|
||||
<div className="py-6">{children}</div>
|
||||
</main>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user