fix: ssr html render inconsistence

This commit is contained in:
DIYgod
2022-11-19 01:01:18 +00:00
parent 0212a1047d
commit a1f052855f
3 changed files with 19 additions and 34 deletions
-15
View File
@@ -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"
]
+16 -16
View File
@@ -56,14 +56,14 @@ export const CharacterCard: React.FC<{
}, [open, firstOpen, siteId, site])
return (
<div {...getReferenceProps({ ref: reference, ...children.props })}>
<span {...getReferenceProps({ ref: reference, ...children.props })}>
{children}
{(open || buttonLoading) && (
<div
<span
{...getFloatingProps({
ref: floating,
className:
"border-gray-100 rounded-lg p-4 bg-white z-10 space-y-2 text-sm w-80 shadow-xl",
"border-gray-100 rounded-lg p-4 bg-white z-10 space-y-2 text-sm w-80 shadow-xl block",
style: {
position: strategy,
top: y ?? "",
@@ -73,7 +73,7 @@ export const CharacterCard: React.FC<{
>
{site ? (
<>
<div className="flex items-center justify-between">
<span className="flex items-center justify-between">
<Avatar
images={site?.avatars || []}
name={site?.name}
@@ -84,21 +84,21 @@ export const CharacterCard: React.FC<{
size="sm"
loadingStatusChange={(status) => setButtonLoading(status)}
/>
</div>
<div>
</span>
<span className="block">
<span className="font-bold text-base">{site?.name}</span>
<span className="ml-1 text-gray-600">@{siteId}</span>
</div>
</span>
{site?.description && (
<div
className="text-gray-600"
<span
className="block text-gray-600"
dangerouslySetInnerHTML={{ __html: site?.description || "" }}
></div>
></span>
)}
<div>
<span className="block">
<FollowingCount siteId={siteId} disableList={true} />
</div>
<div className="text-gray-500">
</span>
<span className="block text-gray-500">
Joined{" "}
{dayjs
.duration(
@@ -107,13 +107,13 @@ export const CharacterCard: React.FC<{
)
.humanize()}{" "}
ago
</div>
</span>
</>
) : (
"Loading..."
)}
</div>
</span>
)}
</div>
</span>
)
}
+3 -3
View File
@@ -53,8 +53,8 @@ function renderItems(items: TocResult["map"], activeId: string, prefix = "") {
<ol className={prefix ? "pl-5" : ""}>
{items?.children?.map((item, index) => (
<li key={index}>
{item.children.map((child: any) => (
<>
{item.children.map((child: any, i) => (
<span key={index + "-" + i}>
{child.type === "paragraph" && child.children?.[0]?.url && (
<Link
to={decodeURI(child.children[0].url.slice(1))}
@@ -78,7 +78,7 @@ function renderItems(items: TocResult["map"], activeId: string, prefix = "") {
)}
{child.type === "list" &&
renderItems(child, activeId, `${index + 1}.`)}
</>
</span>
))}
</li>
))}