1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 07:01:19 -04:00

use stitches-normalize 🧵

https://github.com/jakejarvis/stitches-normalize
This commit is contained in:
2022-03-06 11:24:58 -05:00
parent 9ac0b828d1
commit 34fccfefc3
12 changed files with 111 additions and 180 deletions

View File

@@ -1,4 +1,5 @@
import Tweet from "react-tweet-embed";
import { useTheme } from "next-themes";
import { TwitterTweetEmbed } from "react-twitter-embed";
export type TweetEmbedProps = {
id: string;
@@ -6,16 +7,20 @@ export type TweetEmbedProps = {
className?: string;
};
const TweetEmbed = ({ id, className, options }: TweetEmbedProps) => (
<Tweet
className={className}
tweetId={id}
options={{
dnt: true,
align: "center",
...options,
}}
/>
);
const TweetEmbed = ({ id, options }: TweetEmbedProps) => {
const { resolvedTheme } = useTheme();
return (
<TwitterTweetEmbed
tweetId={id}
options={{
dnt: true,
align: "center",
theme: resolvedTheme === "dark" ? "dark" : "light",
...options,
}}
/>
);
};
export default TweetEmbed;