nygardk / react-share

Social media share buttons and share counts for React
MIT License
2.6k stars 429 forks source link

Hi, is it planned to support the new Twitter "X" icon? Thanks :) #499

Closed vincenzopuzio closed 7 months ago

joeschneider32 commented 10 months ago

I would also like the ability to use the new Twitter "X" logo if possible. Thanks! @nygardk

rolandin commented 10 months ago

You guys can just use your own Icon as children, this is using tailwindcss and my own icon is imported but this is basically the idea:

import { TwitterShareButton } from "react-share";
// import your X icon here
import { MyTwitterXIcon } from "../my-Icons-Path";

// then in your render
  <TwitterShareButton url={'https://www.google.com/'}>
    { /* this is your own Icon you can do to match your styles, now an X */ }
    <MyTwitterXIcon />
  </TwitterShareButton>

At least in "react-share": "^4.4.0", version you can, that's the one Im using

AndreaZero commented 10 months ago

I really need this too! Tried your solution but didn't worked for me in react-share version 4.4.1

You guys can just use your own Icon as children, this is using tailwindcss and my own icon is imported but this is basically the idea:

import { TwitterShareButton } from "react-share";
// import your X icon here
import { MyTwitterXIcon } from "../my-Icons-Path";

// then in your render
  <TwitterShareButton url={'https://www.google.com/'}>
    { /* this is your own Icon you can do to match your styles, now an X */ }
    <MyTwitterXIcon />
  </TwitterShareButton>

At least in "react-share": "^4.4.0", version you can, that's the one Im using

ashikp commented 10 months ago

Is there any other way to get the new logo updated? I need it Badly

joeschneider32 commented 10 months ago

Similar to @rolandin 's solution, here is mine:

import { TwitterShareButton } from "react-share";
import { Avatar } from "@material-ui/core";

return (
   <TwitterShareButton>
      <Avatar
         style={{
            width: size,
            height: size,
            backgroundColor: 'black',
        }}
     >
        <i
           className="fab fa-x-twitter"
           style={{ fontSize: size * 0.6 }}
        />
     </Avatar>
   </TwitterShareButton>
)
ashikp commented 10 months ago

@joeschneider32 Thanks for your solution. Do i need to install fontawesome node for that?

bn-pshulga commented 10 months ago

Still need to add X Icon to pack of available solutions for sharing in socials! Thank you!

nygardk commented 7 months ago

Hey, XIcon has been added in version 5.

bn-pshulga commented 7 months ago

Thanks a lot!