diff --git a/site/docs/components/landing/Tweets.tsx b/site/docs/components/landing/Tweets.tsx new file mode 100644 index 0000000000..fb66269fdf --- /dev/null +++ b/site/docs/components/landing/Tweets.tsx @@ -0,0 +1,109 @@ +import { useEffect, useState } from 'react'; + +const Tweets = () => { + const [scriptLoaded, setScriptLoaded] = useState(false); + + useEffect(() => { + const script = document.createElement('script'); + script.src = 'https://platform.twitter.com/widgets.js'; + script.async = true; + + // Set script onload to true when it's loaded + script.onload = () => { + setScriptLoaded(true); + }; + + // Set script onerror to handle failure to load + script.onerror = () => { + setScriptLoaded(false); + }; + + document.body.appendChild(script); + + // Cleanup the script when the component unmounts + return () => { + document.body.removeChild(script); + }; + }, []); + + if (!scriptLoaded) { + // If the script isn't loaded yet, return null. + return null; + } + + return ( +
+
+

+ Builders ship faster with OnchainKit +

+
+
+
+
+

+ 🟣 Excited to announce that Basenames are now integrated into the + Fit Club app!
+
+ Thanks to{' '} + + @OnchainKit + {' '} + for making it smooth and easy! 💜 +
+
+ More updates on the way, stay fit. 🏋️‍♀️🏋️‍♂️{' '} + pic.twitter.com/5BlIm5kSx3 +

+ — Fit Club (@fitclubonbase){' '} + + August 23, 2024 + +
+
+
+
+

+ The{' '} + + @OnchainKit + {' '} + makes me happy as a developer and excited to write some code + again. +

+ — GoodDev (@YourGoodDev){' '} + + September 26, 2024 + +
+
+

+ Swap is now live on our website! Feels good to be based, thanks + guys 💙{' '} + pic.twitter.com/vunDYrnT2j +

+ — KEYCAT (@KeyboardCatBase){' '} + + September 24, 2024 + +
+
+
+
+ ); +}; + +export default Tweets; diff --git a/site/docs/pages/index.mdx b/site/docs/pages/index.mdx index 782a4b46c4..b7dd4a411b 100644 --- a/site/docs/pages/index.mdx +++ b/site/docs/pages/index.mdx @@ -34,6 +34,7 @@ import { TransactionStatusAction, TransactionStatusLabel, } from '@coinbase/onchainkit/transaction'; +import Tweets from '../components/landing/Tweets'
{' '} -
-
-

Builders ship faster with OnchainKit

-
-
-
-
-

- 🟣 Excited to announce that Basenames are now integrated into the Fit Club app!

- Thanks to @OnchainKit for making it smooth and easy! 💜

- More updates on the way, stay fit. 🏋️‍♀️🏋️‍♂️ pic.twitter.com/5BlIm5kSx3 -

- — Fit Club (@fitclubonbase) August 23, 2024 -
-
-
-

The @OnchainKit makes me happy as a developer and exiting to write some code again.

— GoodDev (@YourGoodDev) September 26, 2024
-

Swap is now live on our website! Feels good to be based, thanks guys 💙 pic.twitter.com/vunDYrnT2j

— KEYCAT (@KeyboardCatBase) September 24, 2024
-
-
-
- + {' '}