-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from itizaworld/feature/implement-share
X のシェア機能
- Loading branch information
Showing
4 changed files
with
34 additions
and
1 deletion.
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
23 changes: 23 additions & 0 deletions
23
src/app/_components/domains/Nippo/NippoShareIcon/NippoShareIcon.tsx
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,23 @@ | ||
'use client'; | ||
|
||
import { Button, Link } from '@nextui-org/react'; | ||
import { format } from 'date-fns'; | ||
|
||
import { Icon } from '~/app/_components/uiParts/icons'; | ||
import { Nippo } from '~/domains/Nippo'; | ||
|
||
export const NippoShareIcon = ({ nippo }: { nippo: Nippo }) => { | ||
return ( | ||
<Link | ||
href={`https://twitter.com/intent/tweet?text=${format(new Date(nippo.date), 'yyyy年MM月dd日')}の日報&hashtags=みんなの日報&url=${ | ||
window.location.href | ||
}`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<Button isIconOnly size="sm" variant="light" radius="full"> | ||
<Icon icon="TWITTER_X" height={16} width={16} /> | ||
</Button> | ||
</Link> | ||
); | ||
}; |
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 @@ | ||
export { NippoShareIcon } from './NippoShareIcon'; |
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