tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
fix hydration error caused by date in bsky embed
awarm.space
5 months ago
382252ae
380fb254
+20
-11
1 changed file
expand all
collapse all
unified
split
app
lish
[did]
[publication]
[rkey]
PublishBskyPostBlock.tsx
+20
-11
app/lish/[did]/[publication]/[rkey]/PublishBskyPostBlock.tsx
···
43
43
let postId = post.uri.split("/")[4];
44
44
let url = `https://bsky.app/profile/${post.author.handle}/post/${postId}`;
45
45
46
46
-
let datetimeFormatted = new Date(
47
47
-
timestamp ? timestamp : "",
48
48
-
).toLocaleString("en-US", {
49
49
-
month: "short",
50
50
-
day: "numeric",
51
51
-
year: "numeric",
52
52
-
hour: "numeric",
53
53
-
minute: "numeric",
54
54
-
hour12: true,
55
55
-
});
56
46
return (
57
47
<div
58
48
className={`
···
98
88
</>
99
89
)}
100
90
<div className="w-full flex gap-2 items-center justify-between">
101
101
-
<div className="text-xs text-tertiary">{datetimeFormatted}</div>
91
91
+
<ClientDate date={timestamp} />
102
92
<div className="flex gap-2 items-center">
103
93
{post.replyCount && post.replyCount > 0 && (
104
94
<>
···
123
113
);
124
114
}
125
115
};
116
116
+
117
117
+
const ClientDate = (props: { date?: string }) => {
118
118
+
let pageLoaded = useInitialPageLoad();
119
119
+
if (!pageLoaded) return null;
120
120
+
121
121
+
let datetimeFormatted = new Date(props.date ? props.date : "").toLocaleString(
122
122
+
"en-US",
123
123
+
{
124
124
+
month: "short",
125
125
+
day: "numeric",
126
126
+
year: "numeric",
127
127
+
hour: "numeric",
128
128
+
minute: "numeric",
129
129
+
hour12: true,
130
130
+
},
131
131
+
);
132
132
+
133
133
+
return <div className="text-xs text-tertiary">{datetimeFormatted}</div>;
134
134
+
};