a tool for shared writing and social publishing
0
fork

Configure Feed

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

super wip pub dashboard

+66 -27
+2
app/home/page.tsx
··· 17 17 import { getFactsFromHomeLeaflets } from "app/api/rpc/[command]/getFactsFromHomeLeaflets"; 18 18 import { HomeSidebar } from "./HomeSidebar"; 19 19 import { HomeFooter } from "./HomeFooter"; 20 + import { MyPublicationList } from "./Publications"; 20 21 21 22 let supabase = createServerClient<Database>( 22 23 process.env.NEXT_PUBLIC_SUPABASE_API_URL as string, ··· 101 102 <div className="home relative max-w-screen-lg w-full h-full mx-auto flex sm:flex-row flex-col sm:items-stretch sm:px-6 "> 102 103 <HomeSidebar /> 103 104 <div className={`h-full overflow-y-scroll`}> 105 + <MyPublicationList /> 104 106 <LeafletList initialFacts={home_docs_initialFacts} /> 105 107 </div> 106 108 <HomeFooter />
+22
app/lish/[handle]/[publication]/PublicationDashboard.tsx
··· 1 + "use client"; 2 + import { useState } from "react"; 3 + 4 + export function PublicationDashboard(props: { name: string }) { 5 + let [tab, setTab] = useState(""); 6 + return ( 7 + <div className="w-full flex flex-col items-stretch"> 8 + <div className="flex flex-row w-full justify-between border-b border-secondary text-secondary"> 9 + <div>{props.name}</div> 10 + <div className="flex flex-row gap-2"> 11 + <Tab name="Drafts" /> 12 + <Tab name="Published" /> 13 + </div> 14 + </div> 15 + <div></div> 16 + </div> 17 + ); 18 + } 19 + 20 + function Tab(props: { name: string }) { 21 + return <div className="border">{props.name}</div>; 22 + }
+42 -27
app/lish/[handle]/[publication]/page.tsx
··· 1 - import { Footer } from "../../Footer"; 2 - import { PostList } from "../../PostList"; 3 - import { getPds, IdResolver } from "@atproto/identity"; 1 + import { IdResolver } from "@atproto/identity"; 4 2 import { supabaseServerClient } from "supabase/serverClient"; 5 - import { CallToActionButton } from "./CallToActionButton"; 6 3 import { Metadata } from "next"; 7 4 import { Fact } from "src/replicache"; 8 5 import { Attributes } from "src/replicache/attributes"; 9 - import { DraftList } from "./DraftList"; 6 + import { ActionButton } from "components/ActionBar/ActionButton"; 7 + import { Sidebar } from "components/ActionBar/Sidebar"; 8 + 9 + import { Media } from "components/Media"; 10 + import { Footer } from "components/ActionBar/Footer"; 11 + import { PublicationDashboard } from "./PublicationDashboard"; 12 + import { AddTiny } from "components/Icons/AddTiny"; 10 13 11 14 const idResolver = new IdResolver(); 12 15 ··· 63 66 64 67 try { 65 68 return ( 66 - <div className="pubPage w-full h-screen bg-bg-leaflet flex items-stretch"> 67 - <div className="pubWrapper flex flex-col w-full "> 68 - <div className="pubContent flex flex-col gap-8 px-4 py-6 mx-auto max-w-prose h-full w-full overflow-auto"> 69 - <div 70 - id="pub-header" 71 - className="pubHeader flex flex-col gap-6 justify-center text-center" 72 - > 73 - <div className="flex flex-col gap-1 w-full place-items-center"> 74 - <h2>{publication.name}</h2> 75 - <CallToActionButton /> 76 - </div> 77 - </div> 78 - <DraftList 79 - drafts={publication.leaflets_in_publications.map((d) => ({ 80 - ...d.permission_tokens!, 81 - initialFacts: facts[d.permission_tokens?.root_entity!], 82 - }))} 69 + <div className="relative max-w-screen-lg w-full h-full mx-auto flex sm:flex-row flex-col sm:items-stretch sm:px-6"> 70 + <Sidebar className="mt-6"> 71 + <ActionButton 72 + id="new-leaflet-button" 73 + primary 74 + icon=<AddTiny className="m-1 shrink-0" /> 75 + label="Create Draft" 76 + /> 77 + </Sidebar> 78 + <div className={`h-full overflow-y-scroll pl-8 pt-8 w-full`}> 79 + <PublicationDashboard name={publication.name} /> 80 + </div> 81 + <Media mobile> 82 + <Footer> 83 + <ActionButton 84 + id="new-leaflet-button" 85 + primary 86 + icon=<AddTiny className="m-1 shrink-0" /> 87 + label="New Doc" 83 88 /> 84 - 85 - <PostList posts={publication.documents_in_publications} /> 86 - </div> 87 - <Footer pageType="pub" /> 88 - </div> 89 + </Footer> 90 + </Media> 89 91 </div> 90 92 ); 91 93 } catch (e) { ··· 97 99 const PubNotFound = () => { 98 100 return <div>ain't no pub here</div>; 99 101 }; 102 + 103 + const Actions = () => { 104 + return ( 105 + <> 106 + <ActionButton 107 + id="new-leaflet-button" 108 + primary 109 + icon=<AddTiny className="m-1 shrink-0" /> 110 + label="Create Draft" 111 + /> 112 + </> 113 + ); 114 + };