diff --git a/actions/getIdentityData.ts b/actions/getIdentityData.ts index eff3f876..6e8bc4f2 100644 --- a/actions/getIdentityData.ts +++ b/actions/getIdentityData.ts @@ -12,7 +12,6 @@ export async function uncachedGetIdentityData() { let auth_token = cookieStore.get("auth_token")?.value || cookieStore.get("external_auth_token")?.value; - console.log("AUTH_TOKEN: " + auth_token); let auth_res = auth_token ? await supabaseServerClient .from("email_auth_tokens") @@ -48,8 +47,6 @@ export async function uncachedGetIdentityData() { .eq("confirmed", true) .single() : null; - console.log("GETTING IDENTITY", auth_res); - if (auth_res?.error) console.log(auth_res.error); if (!auth_res?.data?.identities) return null; // Transform embedded entitlements into a keyed record, filtering expired diff --git a/app/(home-pages)/p/[didOrHandle]/layout.tsx b/app/(home-pages)/p/[didOrHandle]/layout.tsx index b3592802..03576f19 100644 --- a/app/(home-pages)/p/[didOrHandle]/layout.tsx +++ b/app/(home-pages)/p/[didOrHandle]/layout.tsx @@ -100,12 +100,12 @@ export default async function ProfilePageLayout(props: { /> } tabs={{ - Inbox: { href: "/reader/inbox" }, + Inbox: { href: "/reader" }, Trending: { href: "/reader/trending" }, }} > diff --git a/app/(home-pages)/reader/InboxContent.tsx b/app/(home-pages)/reader/InboxContent.tsx index 5ec4f604..036a821a 100644 --- a/app/(home-pages)/reader/InboxContent.tsx +++ b/app/(home-pages)/reader/InboxContent.tsx @@ -13,7 +13,6 @@ import { MobileInteractionPreviewDrawer, } from "./InteractionDrawers"; import { useSelectedPostListing } from "src/useSelectedPostState"; -import { getIdentityData } from "actions/getIdentityData"; import { useIdentityData } from "components/IdentityProvider"; import { LoginContent } from "components/LoginButton"; diff --git a/app/(home-pages)/tag/[tag]/layout.tsx b/app/(home-pages)/tag/[tag]/layout.tsx index 2c33995f..e55bcb8c 100644 --- a/app/(home-pages)/tag/[tag]/layout.tsx +++ b/app/(home-pages)/tag/[tag]/layout.tsx @@ -14,7 +14,7 @@ export default async function TagLayout(props: { id="tag" pageTitle={} pageTitle={decodedTag} />} tabs={{ - Inbox: { href: "/reader/inbox" }, + Inbox: { href: "/reader" }, Trending: { href: "/reader/trending" }, }} > diff --git a/components/ActionBar/DesktopNavigation.tsx b/components/ActionBar/DesktopNavigation.tsx index 00b00ab9..9f599fae 100644 --- a/components/ActionBar/DesktopNavigation.tsx +++ b/components/ActionBar/DesktopNavigation.tsx @@ -26,9 +26,19 @@ function pickActiveTabHref( pathname: string, tabs: { [name: string]: { href: string } }, ): string | null { + const hrefs = Object.values(tabs).map((t) => t.href); let best: string | null = null; - for (const { href } of Object.values(tabs)) { - if (pathname === href || pathname.startsWith(href + "/")) { + for (const href of hrefs) { + // If this href is a strict prefix of another tab's href, only allow exact + // match — otherwise a parent tab would always swallow sibling-but-unmatched + // paths (e.g. /reader/new highlighting /reader's Inbox tab). + const isPrefixOfAnother = hrefs.some( + (other) => other !== href && other.startsWith(href + "/"), + ); + const matches = isPrefixOfAnother + ? pathname === href + : pathname === href || pathname.startsWith(href + "/"); + if (matches) { if (!best || href.length > best.length) best = href; } } @@ -117,7 +127,7 @@ export const PageTitle = (props: { }) => { return (
- {/*{props.icon}*/} + {props.icon}
{props.pageTitle}
diff --git a/components/ActionBar/NavigationButtons.tsx b/components/ActionBar/NavigationButtons.tsx index 6e78a2b3..c7ee534e 100644 --- a/components/ActionBar/NavigationButtons.tsx +++ b/components/ActionBar/NavigationButtons.tsx @@ -39,9 +39,18 @@ export const HomeButton = (props: { className?: string }) => { }; export const WriterButton = () => { + let pathname = usePathname(); + let current = + pathname.startsWith("/home") || + pathname.startsWith("/looseleafs") || + pathname.startsWith("/notifications"); return ( - } label="Write" /> + } + label="Write" + className={current ? "bg-bg-page! border-border-light!" : ""} + /> ); }; diff --git a/components/ActionBar/Publications.tsx b/components/ActionBar/Publications.tsx index 18c150d7..f8eb646f 100644 --- a/components/ActionBar/Publications.tsx +++ b/components/ActionBar/Publications.tsx @@ -30,7 +30,11 @@ export const PublicationButtons = (props: { className?: string }) => { // don't show pub list button if not logged in or no pub list // we show a "start a pub" banner instead - if (!identity || !identity.atp_did || identity.publications.length === 0) + if ( + !identity || + !identity.atp_did || + (!hasLooseleafs && identity.publications.length === 0) + ) return ; return ( diff --git a/components/IdentityProvider.tsx b/components/IdentityProvider.tsx index 85f159dc..bf873ec9 100644 --- a/components/IdentityProvider.tsx +++ b/components/IdentityProvider.tsx @@ -54,7 +54,6 @@ export function IdentityContextProvider(props: { channel.unsubscribe(); }; }, [identity?.atp_did]); - console.log("IDENTITY", identity); return ( {props.children}