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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user