From 07f808a39681ffc7ad8da7ce3844b226bc0db032 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Wed, 24 Aug 2022 01:38:43 +0100 Subject: [PATCH] feat: add xlog-label for custom css --- src/components/common/Comment.tsx | 8 +- src/components/common/PageContent.tsx | 1 + src/components/site/PostFooter.tsx | 173 ++++++++++++++------------ src/components/site/PostMeta.tsx | 5 +- src/components/site/SiteHeader.tsx | 21 +++- src/components/site/SiteHome.tsx | 18 ++- src/components/site/SitePage.tsx | 8 +- src/components/ui/UniLink.tsx | 3 +- 8 files changed, 138 insertions(+), 99 deletions(-) diff --git a/src/components/common/Comment.tsx b/src/components/common/Comment.tsx index 3e2d1314..d02dffd1 100644 --- a/src/components/common/Comment.tsx +++ b/src/components/common/Comment.tsx @@ -78,14 +78,14 @@ export const Comment: React.FC<{ }, [commentPage.isSuccess, form]) return ( -
-
+
+
{comments.data?.length || "0"} Comment {comments.data?.length && comments.data.length > 1 ? "s" : ""}
-
+
-
+
{comments.data?.map((comment) => (
diff --git a/src/components/site/PostFooter.tsx b/src/components/site/PostFooter.tsx index 9f0d26e7..08607764 100644 --- a/src/components/site/PostFooter.tsx +++ b/src/components/site/PostFooter.tsx @@ -158,90 +158,99 @@ export const PostFooter: React.FC<{ return ( <> -
- -
    setIsLikeListOpen(true)} - > - {likes.data?.list - ?.sort((a, b) => - b.fromCharacter?.metadata?.content?.avatars ? 1 : -1, - ) - .slice(0, 3) - ?.map((like: any, index) => ( -
  • - +
    +
    + +
      setIsLikeListOpen(true)} + > + {likes.data?.list + ?.sort((a, b) => + b.fromCharacter?.metadata?.content?.avatars ? 1 : -1, + ) + .slice(0, 3) + ?.map((like: any, index) => ( +
    • + +
    • + ))} + {(likes.data?.count || 0) > 3 && ( +
    • +
      + +{likes.data!.count - 3} +
    • - ))} - {(likes.data?.count || 0) > 3 && ( -
    • -
      - +{likes.data!.count - 3} -
      -
    • - )} -
    - -
      setIsMintListOpen(true)} - > - {mints.data?.list - ?.sort((a, b: any) => - b.character?.metadata?.content?.avatars ? 1 : -1, - ) - .slice(0, 3) - .map((mint: any, index) => ( -
    • - + )} +
    +
    +
    + +
      setIsMintListOpen(true)} + > + {mints.data?.list + ?.sort((a, b: any) => + b.character?.metadata?.content?.avatars ? 1 : -1, + ) + .slice(0, 3) + .map((mint: any, index) => ( +
    • + +
    • + ))} + {(mints.data?.count || 0) > 3 && ( +
    • +
      + +{mints.data!.count - 3} +
    • - ))} - {(mints.data?.count || 0) > 3 && ( -
    • -
      - +{mints.data!.count - 3} -
      -
    • - )} -
    + )} +
+
= ({ page }) => { return (
- {formatDate(page.date_published)} + + {formatDate(page.date_published)} + ยท diff --git a/src/components/site/SiteHeader.tsx b/src/components/site/SiteHeader.tsx index cee89341..a2aafcff 100644 --- a/src/components/site/SiteHeader.tsx +++ b/src/components/site/SiteHeader.tsx @@ -166,24 +166,34 @@ export const SiteHeader: React.FC<{
-
+
{site?.avatars?.[0] && ( )}
-
+
{site?.name}
{site?.bio && ( -
{site?.bio}
+
+ {site?.bio} +
)}
{siteSubscriptions.data ? ( setIsFollowListOpen(true)} > @@ -270,7 +280,10 @@ export const SiteHeader: React.FC<{
-
+
{leftLinks.map((link, i) => { return })} diff --git a/src/components/site/SiteHome.tsx b/src/components/site/SiteHome.tsx index 4241b812..03b21553 100644 --- a/src/components/site/SiteHome.tsx +++ b/src/components/site/SiteHome.tsx @@ -12,17 +12,25 @@ export const SiteHome: React.FC<{
{posts.total === 0 && } {posts.total > 0 && ( -
+
{posts.list.map((post) => { const excerpt = post.summary?.content return ( - -

{post.title}

-
+ +

+ {post.title} +

+
{formatDate(post.date_published)}
-
+
{excerpt} {excerpt && "..."}
diff --git a/src/components/site/SitePage.tsx b/src/components/site/SitePage.tsx index 376d8933..977a1791 100644 --- a/src/components/site/SitePage.tsx +++ b/src/components/site/SitePage.tsx @@ -13,9 +13,13 @@ export const SitePage: React.FC<{ <>
{page?.tags?.includes("post") ? ( -

{page.title}

+

+ {page.title} +

) : ( -

{page?.title}

+

+ {page?.title} +

)} {page?.tags?.includes("post") && }
diff --git a/src/components/ui/UniLink.tsx b/src/components/ui/UniLink.tsx index e6c751f1..1ab03034 100644 --- a/src/components/ui/UniLink.tsx +++ b/src/components/ui/UniLink.tsx @@ -5,7 +5,7 @@ export const UniLink: React.FC<{ onClick?: () => void children: React.ReactNode className?: string -}> = ({ href, onClick, children, className }) => { +}> = ({ href, onClick, children, className, ...props }) => { if (onClick) { return (