An ultra simple button to share posts to social media (Facebook & Twitter) 🗣️
Note: This package is for Vulcan 1.0.0, running with GraphQL.
Clone this repo in your vulcan's /packages
folder.
Open the .meteor/packages
file of your app and add at the end of the Feature packages section:
xavcz:vulcan-social-share
In your custom package, edit the package.js
file and add xavcz:vulcan-social-share
as a dependency, near by the other vulcan:xxx
packages.
Sweet! You're now ready to use this package for your custom components!
Let's say you have a custom component which has access to a post
document, given as a React prop.
// in the render of your custom component
<Components.SocialButton type="facebook" post={post} /> // facebook share
<Components.SocialButton type="twitter" post={post} /> // twitter share
<Components.SocialButton type="linkedin" post={post} /> // linkedin share
// you can also give it your own styling if you don't like the current styles
<Components.SocialButton type="twitter" post={post} className="my-awesome-styling" />
If you want more social services, feel free to open a pull request and add your modifications. I would be glad to add more services! 😃
As we use GraphQL now, we could easily extend the vulcan schema with some fields querying Facebook / Twitter / xxx API to get insights on these posts (how many shares? how many likes? ...). If you are interested in that, open a pull request! If you don't know how to, come by the vulcan slack chatroom and ping me, I'll guide you 👍