justinmahar / react-social-media-embed

📰 Easily embed social media posts from Facebook, Instagram, LinkedIn, Pinterest, TikTok, X (Twitter), and YouTube in React.
https://justinmahar.github.io/react-social-media-embed/
MIT License
215 stars 30 forks source link

feat: Re-enable "captioned" prop in InstagramEmbed component #60

Closed shahinrahimi closed 9 months ago

shahinrahimi commented 9 months ago

This pull request addresses allowing users to determine whether captions should be displayed or not.

Changes made: I've introduced a new prop, 'captioned,' to the InstagramEmbed component's properties. When this prop is set to true, the "data-instgrm-captioned" attribute will be set to true. Conversely, if the prop is set to false, the attribute will be left undefined

Here's how it operates: When the 'captioned' prop is set to true, the component operates normally, displaying captions. Conversely, if the 'captioned' prop is set to false, the captions will be hidden. The default behavior is set to false.

I've thoroughly tested this enhancement and achieved excellent results.

Fixes #46

Best

justinmahar commented 9 months ago

Thanks for adding this! Built and shipped it to npm.

npm i react-social-media-embed@latest

Give it a try!