a tool for shared writing and social publishing
0
fork

Configure Feed

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

add pub icon to homepage list

+18 -1
+18 -1
app/home/Publications.tsx
··· 11 11 getPublicationURL, 12 12 } from "app/lish/createPub/getPublicationURL"; 13 13 import { Json } from "supabase/database.types"; 14 + import { PubLeafletPublication } from "lexicons/api"; 15 + import { AtUri } from "@atproto/syntax"; 14 16 15 17 export const MyPublicationList = () => { 16 18 let { identity } = useIdentityData(); ··· 52 54 }; 53 55 54 56 function Publication(props: { uri: string; name: string; record: Json }) { 57 + let record = props.record as PubLeafletPublication.Record; 55 58 return ( 56 59 <Link 57 60 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" 58 61 href={`${getBasePublicationURL(props)}/dashboard`} 59 62 > 60 - <div className="w-6 h-6 rounded-full bg-test" /> 63 + {record.icon ? ( 64 + <div 65 + style={{ 66 + backgroundRepeat: "no-repeat", 67 + backgroundPosition: "center", 68 + backgroundSize: "cover", 69 + backgroundImage: `url(/api/atproto_images?did=${new AtUri(props.uri).host}&cid=${(record.icon?.ref as unknown as { $link: string })["$link"]})`, 70 + }} 71 + className="w-6 h-6 rounded-full" 72 + /> 73 + ) : ( 74 + <div className="w-6 h-6 rounded-full"> 75 + {props.name[0].toLocaleUpperCase()} 76 + </div> 77 + )} 61 78 <h4 className="font-bold w-full truncate">{props.name}</h4> 62 79 </Link> 63 80 );