diff --git a/app/components/PostCard.tsx b/app/components/PostCard.tsx index 85331ba..a295a97 100644 --- a/app/components/PostCard.tsx +++ b/app/components/PostCard.tsx @@ -34,61 +34,77 @@ export default function PostCard({ ? `/${encodeURIComponent(authorDid)}/pub/${encodeURIComponent(pubRkey)}/${encodeURIComponent(rkey)}` : '/') - const cardInner = ( -
- {coverImageCid && ( -
+ const postLink = (children: React.ReactNode, className?: string) => + href + ? {children} + : {children} + + return ( +
  • +
    + {coverImageCid && postLink( -
    - )} -
    -
    -

    - {title} -

    - {isDraft && ( - - Draft - - )} -
    - {(textContent || description) && ( -

    - {textContent || description} -

    + />, + 'block w-28 md:w-32 shrink-0 overflow-hidden bg-stone-100 dark:bg-stone-800', )} -
    -

    - {[resolvedHandle ? `@${resolvedHandle}` : null, publicationName].filter(Boolean).join(' · ')} -

    -

    - {new Date(publishedAt).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' })} -

    +
    + {postLink( + <> +
    +

    + {title} +

    + {isDraft && ( + + Draft + + )} +
    + {(textContent || description) && ( +

    + {textContent || description} +

    + )} + , + 'block', + )} +
    +

    + {resolvedHandle && ( + <> + + @{resolvedHandle} + + {publicationName && ' · '} + + )} + {publicationName && (pubRkey + ? + {publicationName} + + : publicationName + )} +

    +

    + {new Date(publishedAt).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' })} +

    +
    -
    - ) - - return ( -
  • - {href ? ( - - {cardInner} - - ) : ( - - {cardInner} - - )}
  • ) }