diff --git a/common/util/tweet-embed.tsx b/common/util/tweet-embed.tsx
index 5dc7d628..91b2fa65 100644
--- a/common/util/tweet-embed.tsx
+++ b/common/util/tweet-embed.tsx
@@ -1,13 +1,19 @@
import { NodeViewWrapper } from '@tiptap/react'
import { TwitterTweetEmbed } from 'react-twitter-embed'
-export default function WrappedTwitterTweetEmbed(props: any): JSX.Element {
- console.log('wtwe props', props.node.attrs)
+export default function WrappedTwitterTweetEmbed(props: {
+ node: {
+ attrs: {
+ tweetId: string
+ }
+ }
+}): JSX.Element {
+ // Remove the leading 't' from the tweet id
+ const tweetId = props.node.attrs.tweetId.slice(1)
+
return (
-
+
)
}
diff --git a/web/components/editor/tweetModal.tsx b/web/components/editor/tweetModal.tsx
index e5983ad9..a6fac5db 100644
--- a/web/components/editor/tweetModal.tsx
+++ b/web/components/editor/tweetModal.tsx
@@ -22,8 +22,9 @@ export function TweetModal(props: {
const { editor, open, setOpen } = props
const [input, setInput] = useState('')
const tweetId = getTweetId(input)
- const tweetCode = ``
- console.log('tweetCode', tweetCode)
+ // Append a leading 't', to prevent tweetId from being interpreted as a number.
+ // If it's a number, there may be numeric precision issues.
+ const tweetCode = ``
return (
@@ -32,7 +33,7 @@ export function TweetModal(props: {
htmlFor="embed"
className="block text-sm font-medium text-gray-700"
>
- Tweet link
+ Paste a tweet link