-
Notifications
You must be signed in to change notification settings - Fork 15
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
1 parent
025ef40
commit 5390cb2
Showing
15 changed files
with
88 additions
and
72 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
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
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
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,15 @@ | ||
import { extractLastPathname } from '@/lib/urlPatterns' | ||
import { TwitterTweetEmbed } from 'react-twitter-embed' | ||
import css from './styles.module.css' | ||
|
||
const Twitter = ({ url }: { url: string }) => { | ||
const tweetId = extractLastPathname(url) | ||
|
||
return ( | ||
<div className={css.tweetContainer}> | ||
<TwitterTweetEmbed tweetId={tweetId} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default Twitter |
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,9 @@ | ||
.tweetContainer { | ||
margin: 24px auto 0; | ||
width: 80%; | ||
} | ||
|
||
.tweetContainer > * { | ||
display: flex; | ||
justify-content: center; | ||
} |
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,16 +1,23 @@ | ||
import { extractYouTubeVideoId } from '@/lib/urlPatterns' | ||
import css from './styles.module.css' | ||
|
||
const Youtube = ({ embedId }: { embedId: string }) => ( | ||
<div className={css.videoResponsive}> | ||
<iframe | ||
width="853" | ||
height="480" | ||
src={`https://www.youtube-nocookie.com/embed/${embedId}`} | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" | ||
allowFullScreen | ||
title="Embedded youtube" | ||
/> | ||
</div> | ||
) | ||
const YouTube = ({ url }: { url: string }) => { | ||
const videoId = extractYouTubeVideoId(url) | ||
|
||
export default Youtube | ||
if (!videoId) return null | ||
|
||
return ( | ||
<div className={css.videoResponsive}> | ||
<iframe | ||
width="853" | ||
height="480" | ||
src={`https://www.youtube-nocookie.com/embed/${videoId}`} | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" | ||
allowFullScreen | ||
title="Embedded YouTube" | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default YouTube |
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
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
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
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