diff --git a/app/(home-pages)/home/HomeLayout.tsx b/app/(home-pages)/home/HomeLayout.tsx index 7c31a67f..9669e893 100644 --- a/app/(home-pages)/home/HomeLayout.tsx +++ b/app/(home-pages)/home/HomeLayout.tsx @@ -211,7 +211,7 @@ export function LeafletList(props: { className={` leafletList w-full - ${display === "grid" ? "grid auto-rows-max md:grid-cols-4 sm:grid-cols-3 grid-cols-2 gap-y-4 gap-x-4 sm:gap-x-6 sm:gap-y-5 grow" : "flex flex-col gap-2 pt-2"} `} + ${display === "grid" ? "grid auto-rows-max md:grid-cols-4 sm:grid-cols-3 grid-cols-2 gap-y-4 gap-x-4 sm:gap-x-6 sm:gap-y-5 grow" : "flex flex-col gap-2 "} `} > {props.leaflets.map(({ token: leaflet, added_at, archived }, index) => ( } tabs={{ - home: { + Drafts: { + controls: ( + + ), + content: , + }, + Published: { controls: null, content: ( { + if (props.empty) + return ( + + + You haven't written any looseleaf drafts yet. + + + Start a Looseleaf Draft + + + ); + return ( + + New Looseleaf Draft + This is where the draft would go if we had them lol + + ); +}; + export const LooseleafList = (props: { titles: { [root_entity: string]: string }; initialFacts: { @@ -102,6 +138,17 @@ export const LooseleafList = (props: { token: ptoh.permission_tokens as PermissionToken, })) : []; + + if (!leaflets || leaflets.length === 0) + return ( + + You haven't published any looseleafs yet. + + Start a Looseleaf Draft + + + ); + return ( { let { identity } = useIdentityData(); - let looseleaves = identity?.permission_token_on_homepage.find( + let hasLooseleafs = !!identity?.permission_token_on_homepage.find( (f) => f.permission_tokens.leaflets_to_documents, ); @@ -34,7 +34,7 @@ export const PublicationButtons = (props: { return ( - {looseleaves && ( + {hasLooseleafs && ( <> { + return ( + + {props.children} + + ); +};