a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

don't view dashboard on pub domain

+27 -10
+5 -2
app/[leaflet_id]/Actions.tsx
··· 1 1 import { publishToPublication } from "actions/publishToPublication"; 2 - import { getPublicationURL } from "app/lish/createPub/getPublicationURL"; 2 + import { 3 + getBasePublicationURL, 4 + getPublicationURL, 5 + } from "app/lish/createPub/getPublicationURL"; 3 6 import { ActionButton } from "components/ActionBar/ActionButton"; 4 7 import { ArrowRightTiny } from "components/Icons/ArrowRightTiny"; 5 8 import { GoBackSmall } from "components/Icons/GoBackSmall"; ··· 25 28 let { identity } = useIdentityData(); 26 29 return ( 27 30 <Link 28 - href={`${getPublicationURL(props.publication)}/dashboard`} 31 + href={`${getBasePublicationURL(props.publication)}/dashboard`} 29 32 className="hover:!no-underline" 30 33 > 31 34 <ActionButton
+5 -2
app/home/Publications.tsx
··· 6 6 import { theme } from "tailwind.config"; 7 7 import { BlueskyTiny } from "components/Icons/BlueskyTiny"; 8 8 import { AddTiny } from "components/Icons/AddTiny"; 9 - import { getPublicationURL } from "app/lish/createPub/getPublicationURL"; 9 + import { 10 + getBasePublicationURL, 11 + getPublicationURL, 12 + } from "app/lish/createPub/getPublicationURL"; 10 13 import { Json } from "supabase/database.types"; 11 14 12 15 let allowlist = [ ··· 59 62 return ( 60 63 <Link 61 64 className="pubListItem w-full p-3 opaque-container rounded-lg! text-secondary text-center hover:no-underline flex flex-col gap-1 place-items-center transparent-outline outline-2 outline-offset-1 hover:outline-border basis-0 grow min-w-0" 62 - href={`${getPublicationURL(props)}/dashboard`} 65 + href={`${getBasePublicationURL(props)}/dashboard`} 63 66 > 64 67 <div className="w-6 h-6 rounded-full bg-test" /> 65 68 <h4 className="font-bold w-full truncate">{props.name}</h4>
+2 -2
app/lish/createPub/CreatePubForm.tsx
··· 9 9 import { useState, useRef, useEffect } from "react"; 10 10 import { useDebouncedEffect } from "src/hooks/useDebouncedEffect"; 11 11 import { theme } from "tailwind.config"; 12 - import { getPublicationURL } from "./getPublicationURL"; 12 + import { getBasePublicationURL, getPublicationURL } from "./getPublicationURL"; 13 13 import { string } from "zod"; 14 14 15 15 type DomainState = ··· 46 46 // Show a spinner while this is happening! Maybe a progress bar? 47 47 setTimeout(() => { 48 48 if (data?.publication) 49 - router.push(`${getPublicationURL(data.publication)}/dashboard`); 49 + router.push(`${getBasePublicationURL(data.publication)}/dashboard`); 50 50 }, 500); 51 51 }} 52 52 >
+10 -2
app/lish/createPub/getPublicationURL.ts
··· 9 9 record: Json; 10 10 }) { 11 11 let record = pub.record as PubLeafletPublication.Record; 12 - if (isProductionDomain() && record?.base_path) { 12 + if (isProductionDomain() && record?.base_path) 13 13 return `https://${record.base_path}`; 14 - } 14 + else return getBasePublicationURL(pub); 15 + } 16 + 17 + export function getBasePublicationURL(pub: { 18 + uri: string; 19 + name: string; 20 + record: Json; 21 + }) { 22 + let record = pub.record as PubLeafletPublication.Record; 15 23 let aturi = new AtUri(pub.uri); 16 24 return `/lish/${aturi.host}/${record?.name || pub.name}`; 17 25 }
+5 -2
components/Pages/PublicationMetadata.tsx
··· 11 11 import { AtUri } from "@atproto/syntax"; 12 12 import { PubLeafletDocument } from "lexicons/api"; 13 13 import { publications } from "drizzle/schema"; 14 - import { getPublicationURL } from "app/lish/createPub/getPublicationURL"; 14 + import { 15 + getBasePublicationURL, 16 + getPublicationURL, 17 + } from "app/lish/createPub/getPublicationURL"; 15 18 export const PublicationMetadata = ({ 16 19 cardBorderHidden, 17 20 }: { ··· 55 58 > 56 59 <div className="flex gap-2"> 57 60 <Link 58 - href={`${getPublicationURL(pub.publications)}/dashboard`} 61 + href={`${getBasePublicationURL(pub.publications)}/dashboard`} 59 62 className="text-accent-contrast font-bold hover:no-underline" 60 63 > 61 64 {pub.publications?.name}