-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yossydev
committed
Mar 5, 2024
1 parent
6492ef1
commit cc78295
Showing
4 changed files
with
60 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { LINK } from "../constants"; | ||
|
||
export default function Share({ title }: { title: string }) { | ||
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?url=${window.location.href}&text=${title}`} | ||
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { jsxRenderer } from "hono/jsx-renderer"; | ||
import Share from "../../islands/share"; | ||
|
||
export default jsxRenderer(({ children, Layout, frontmatter }) => { | ||
const _title = `${frontmatter?.title} | yossy.dev`; | ||
return ( | ||
<Layout | ||
title={`${frontmatter?.title} | yossy.dev`} | ||
description={frontmatter?.description} | ||
> | ||
<Layout title={_title} description={frontmatter?.description}> | ||
<div class="markdown">{children}</div> | ||
<Share title={_title} /> | ||
</Layout> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createRoute } from "honox/factory"; | ||
import Share from "../../islands/share"; | ||
|
||
export default createRoute((c) => { | ||
return c.render( | ||
<div> | ||
<h1>Hello</h1> | ||
</div>, | ||
{}, | ||
); | ||
}); |