-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SnsButton.tsx
44 lines (41 loc) · 1.14 KB
/
SnsButton.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import type { FC } from "hono/jsx";
import { LINK } from "../constants";
const SnsButton: FC<{ title: string }> = ({ title }) => {
if (typeof window === "undefined") {
return (
<div class="flex items-center justify-center mt-10 gap-3 ">
<div role="status" class="max-w-sm animate-pulse w-full">
<div class="h-11 bg-gray-200 rounded-3xl w-full" />
</div>
</div>
);
}
return (
<div class="flex items-center justify-center mt-10 gap-3">
<a
href={`https://twitter.com/share?text=${encodeURI(title)}&url=${
window.location.href
}`}
target={"_blank"}
rel={"noreferrer"}
class="bg-[#0f1419] text-white flex items-center text-sm rounded-3xl py-3 px-4"
>
<img
src="/static/twitter-alt.svg"
alt="xにシェアする"
class="w-4 h-4 mr-1"
/>
Post
</a>
<a
href={LINK.X}
target={"_blank"}
rel={"noreferrer"}
class="bg-gray-200 flex items-center text-sm rounded-3xl py-3 px-4"
>
Follow @yossydev
</a>
</div>
);
};
export default SnsButton;