Skip to content

Commit

Permalink
feat: always use light mode for TweetCard
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorusclarence committed Dec 31, 2022
1 parent f56ae81 commit 4cde5f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/components/content/TweetCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import clsx from 'clsx';
import { useTheme } from 'next-themes';
import * as React from 'react';
import { Tweet, TweetProps } from 'react-twitter-widgets';

Expand All @@ -8,14 +7,12 @@ type TweetCardProps = {
} & TweetProps;

export default function TweetCard({ tweetId, className }: TweetCardProps) {
const { theme } = useTheme();

return (
/** Adding width 99% because iframe cuts border
* @see https://stackoverflow.com/questions/20039576/show-right-border-on-inner-iframe-which-is-being-cut-off-on-100-width/20039683
*/
<div className={clsx('not-prose w-[99%]', className)}>
<Tweet tweetId={tweetId} options={{ theme }} />
<div className={clsx('not-prose w-[99%] ', className)}>
<Tweet tweetId={tweetId} />
</div>
);
}
3 changes: 2 additions & 1 deletion src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
/* #region /**=========== Twitter Embed =========== */
.twitter-tweet.twitter-tweet-rendered {
margin: 0 auto !important;
border-radius: 12px;
overflow: hidden;
}
.tweet-custom-border {
@apply rounded-xl border-r border-gray-300 dark:border-gray-700;
Expand All @@ -151,7 +153,6 @@
@apply !border-0;
}
}

/* #endregion /**======== Twitter Embed =========== */

/* #region /**=========== Like Button Animation =========== */
Expand Down

0 comments on commit 4cde5f4

Please sign in to comment.