feat: share post to other apps

This commit is contained in:
gosangam
2026-05-31 08:04:46 +05:30
parent 03b8f85e06
commit 336f478f8b
13 changed files with 1290 additions and 82 deletions
+9 -5
View File
@@ -14,7 +14,7 @@
*/
import { Suspense, useEffect } from "react";
import { useRouter, useSearchParams } from "next/navigation";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import {
AtSign,
Bookmark,
@@ -102,9 +102,13 @@ export default function MeLayout({ children }: { children: React.ReactNode }) {
function ConditionalTabs({ tabs }: { tabs: ProfileTab[] }) {
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 pathname = usePathname();
// Hide tabs when the user is in a focused subview:
// • /u/me?edit=1 — the inline profile-edit form
// • /u/me/settings — the reading-prefs page
// In either case the strip is visual noise that distracts from the
// task they navigated in to do.
const editMode = searchParams.get("edit") === "1";
return editMode ? null : <ProfileTabs tabs={tabs} />;
const settingsMode = pathname.startsWith("/u/me/settings");
return editMode || settingsMode ? null : <ProfileTabs tabs={tabs} />;
}