From a1f052855f8933c6038b9ae906a3dfb2f99e80ff Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 19 Nov 2022 01:01:18 +0000 Subject: [PATCH] fix: ssr html render inconsistence --- showcase.json | 15 ------------ src/components/common/CharacterCard.tsx | 32 ++++++++++++------------- src/components/site/PostToc.tsx | 6 ++--- 3 files changed, 19 insertions(+), 34 deletions(-) diff --git a/showcase.json b/showcase.json index 4474a107..d39c94f9 100644 --- a/showcase.json +++ b/showcase.json @@ -12,35 +12,23 @@ "crossbell-io-updates", "xtao", "polebug", - "pengchao", "boyuand", - "lilo", "coolcat", - "dao", - "0x55f110395c844963b075674e2956eb414018a7a7", "139", "just1lovewrl", "kanikig", "coosir", - "atryte", - "qihangsun", - "brucexx", "0x1", "duogeyu", - "stone", "lastmelody", "12138", "isheep", - "atryte", "henryqw", - "whost", "twifag", "hominsu", "exodus-exodus", - "zoo", "colojayce", "stars", - "nss", "somehacker", "novonine", "nafidurmus", @@ -48,8 +36,6 @@ "fblauer", "anxiete", "batman", - "hoho", - "kyleten", "kumasanki", "luftmonsch", "ventuss", @@ -65,6 +51,5 @@ "walt", "adazz", "ark", - "haoz0x", "hans" ] diff --git a/src/components/common/CharacterCard.tsx b/src/components/common/CharacterCard.tsx index 92f02b34..9e6f207d 100644 --- a/src/components/common/CharacterCard.tsx +++ b/src/components/common/CharacterCard.tsx @@ -56,14 +56,14 @@ export const CharacterCard: React.FC<{ }, [open, firstOpen, siteId, site]) return ( -
+ {children} {(open || buttonLoading) && ( -
{site ? ( <> -
+ setButtonLoading(status)} /> -
-
+ + {site?.name} @{siteId} -
+ {site?.description && ( -
+ > )} -
+ -
-
+ + Joined{" "} {dayjs .duration( @@ -107,13 +107,13 @@ export const CharacterCard: React.FC<{ ) .humanize()}{" "} ago -
+ ) : ( "Loading..." )} -
+
)} -
+ ) } diff --git a/src/components/site/PostToc.tsx b/src/components/site/PostToc.tsx index febc241d..3cd92815 100644 --- a/src/components/site/PostToc.tsx +++ b/src/components/site/PostToc.tsx @@ -53,8 +53,8 @@ function renderItems(items: TocResult["map"], activeId: string, prefix = "") {
    {items?.children?.map((item, index) => (
  1. - {item.children.map((child: any) => ( - <> + {item.children.map((child: any, i) => ( + {child.type === "paragraph" && child.children?.[0]?.url && ( + ))}
  2. ))}