saravieira / react-social-sharing Goto Github PK
View Code? Open in Web Editor NEWReact Implementation of @mxstbr https://sharingbuttons.io
Home Page: https://react-social-sharing.now.sh/
License: MIT License
React Implementation of @mxstbr https://sharingbuttons.io
Home Page: https://react-social-sharing.now.sh/
License: MIT License
I've installed cross-env manually, but the installation still fails; log: https://gist.github.com/slikts/da1d7b5c7ed7597c07e3056fb8b45b26
I really love this plugin. Thanks for providing it. Pinterest requires two parts to their url. They have a media link and they have a url link. It appears we can only pass the link and it gets put in both. Is there any way to have it so that it will not pull both and instead have two parameters one for media and one for the url to redirect to? Or am I missing something?
This issue was created by Maintainers Wanted ๐ค
Support us by leaving a star on Github! ๐
Do you use react-social-sharing personally or at work and would like this project to be further developed and improved?
Or are you already a contributor and ready to take the next step to becoming a maintainer?
If you are interested, comment here below on this issue ๐ or drop me a message on Twitter! ๐
React 18 support would be nice
Hey Sara! ๐
jest
as a (non-dev) dependency. Is this expected?react
as a peer dependency?the Facebook button does not render
I get this error when I use the latest version 1.4.0
below is my error
error /Users/farisroslan/Desktop/projects/postco-apps/postco/client/node_modules/react-social-sharing: Command failed.
Exit code: 1
Command: npm run dist:modules
Arguments:
Directory: /Users/farisroslan/Desktop/projects/postco-apps/postco/client/node_modules/react-social-sharing
Output:
> [email protected] dist:modules /Users/farisroslan/Desktop/projects/postco-apps/postco/client/node_modules/react-social-sharing
> del-cli ./dist-modules && cross-env BABEL_ENV=modules babel ./src --out-dir ./dist-modules
sh: del-cli: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] dist:modules: `del-cli ./dist-modules && cross-env BABEL_ENV=modules babel ./src --out-dir ./dist-modules`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] dist:modules script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/farisroslan/.npm/_logs/2018-08-14T06_16_36_346Z-debug.log
v1.3.3
and 1.3.2
work fine
Thanks for the library!
Hello here ๐
I was trying to add this module using yarn and npm but got the same error
โ yarn add react-social-sharing
yarn add v1.7.0
info No lockfile found.
[1/4] Resolving packages...
warning @zeit/next-css > css-loader > cssnano > autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning @zeit/next-css > css-loader > cssnano > postcss-merge-rules > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning @zeit/next-css > css-loader > cssnano > postcss-merge-rules > caniuse-api > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@zeit/next-css > [email protected]" has unmet peer dependency "webpack@^3.1.0".
warning " > [email protected]" has unmet peer dependency "[email protected] - 3".
warning " > [email protected]" has unmet peer dependency "popper.js@^1.14.3".
[4/4] Building fresh packages...
[1/3] โก uglifyjs-webpack-plugin
[3/3] โก react-social-sharing
error /folder/ui/node_modules/react-social-sharing: Command failed.
Exit code: 1
Command: npm run dist:modules
Arguments:
Directory: /folder/ui/node_modules/react-social-sharing
Output:
> [email protected] dist:modules /folder/ui/node_modules/react-social-sharing
> cross-env BABEL_ENV=modules babel ./src --out-dir ./dist-modules
sh: 1: cross-env: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] dist:modules: `cross-env BABEL_ENV=modules babel ./src --out-dir ./dist-modules`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] dist:modules script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
Apparently issue can be solved installing cross-env
Hey, @SaraVieira
Loving this project! I would like to ask you if you are open to supporting a minimal line style, something like:
๐
Right now the body of mail share buttons is hard-coded to just contain the link. I'd like to be able to set a custom body, e.g. via a new body
prop.
One concern to be considered if this were to be added: the name of the existing message
prop, which would still control the subject, would become quite ambiguous. Does it control the subject or the body? I see two solutions:
body
propmessage
prop to subject
, and add a new body
prop (breaking change)Currently, generated links have escaped ampersands, ie for e-mail &
is used:
https://github.com/SaraVieira/react-social-sharing/blob/master/src/consts.js#L38-L41
But React DOM escapes any value and this leads to double escaping and as a result E-mail sharing buttons (and probably others as well) do not work correctly.
From what I see fix for this would be to unescape all&
in
https://github.com/SaraVieira/react-social-sharing/blob/master/src/consts.js
Hi, is there any callback function that can be executed when a sharing is done? may be just a console.log indicating 'Okay the sharing is successfull'?
I would love to add contribution.md file. How do you see that?.
Great build, and the docs are ON POINT. Just wondering if each social icon supports a unique ID? (ie. #shared-on-twitter). Mainly asking for analytic reason.
Thanks!
I am able to add share icon to my react project
But when I mouseover the icon, I see <a>
tag behavior...
like the button text got blue color and underline...
<Twitter solid big message="xxx" link="xxx" />
How do I fix it? btw I am using nextjs
Thanks.
Hi! Any chance you could update the blue Twitter button to be a black X button?
Is there a way to view thumbnail or image to the post im sharing, e.g:-
In the file consts.js
:
whatsapp: function whatsapp() {
var link = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return 'whatsapp://send?text=' + encodeURIComponent(message) + '%20' + encodeURIComponent(link);
},
For some reason, a space is added after the send?text=
portion in the button's sharing link, before the URL. I don't use a Message
attribute for the component, so I think that's the reason. This case should be better taken care of.
Also, this link doesn't work for desktop (WhatsApp web). You should consider changing the API link to using https://api.whatsapp.com/send?
instead of whatsapp://
.
Solution is to set target
to _self
.
i would love to add Instagram button. How do you see that?
is there a way to share images in other share buttons besides the pinterest media field?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.