ui enhancements

This commit is contained in:
gosangam
2026-05-31 00:26:05 +05:30
parent dcdd2383c6
commit ec20eb996b
16 changed files with 951 additions and 9317 deletions
+7 -2
View File
@@ -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>
);