Giter Site home page Giter Site logo

react-social's People

Contributors

alexsugak avatar amitom avatar arvinkx avatar balmasich avatar bartekgruszka avatar bsa7 avatar dlakata avatar exdeniz avatar kweiberth avatar linkesch avatar maxs15 avatar queso avatar riverkanies avatar rnevius avatar roma-so avatar vkammerer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-social's Issues

Problem when sharing to Google Plus

Message prop not working on Facebook Button

The message prop seems to work on Twitter but not Facebook. Any advice?

<FacebookButton appId="..........." url="www.google.com" message='Message goes here'>

<TwitterButton url="www.google.com" message='Message goes here'>

Unknown prop `sharer` on <span> tag

drop warning that sharer is unknown prop

import ReactSocial from 'react-social';
const { FacebookButton, TwitterButton } = ReactSocial;
<FacebookButton
            element={'span'}
            url={url}
            sharer
            className={s.fb}
            appId={sharing.facebook.app_id}
            windowOptions={['status=0', 'toolbar=0', 'width=480', 'height=350']}
          >

warning.js:36 Warning: Unknown prop sharer on tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop

Question: Is it possible to share a blob in place of an image?

I want to use this library as my main social sharing but what I want to share outside of the url and an image url, I also want to share a blob or a HTML5 canvas dataUrI to facebook or whatever social network? Just curious if it is possible using this library?

Problem with server rendering

warning.js:45 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the undefined component.

warning @ warning.js:45
getInternalInstanceReadyForUpdate @ ReactUpdateQueue.js:34
ReactUpdateQueue.enqueueSetState  @ ReactUpdateQueue.js:181
ReactComponent.setState @ ReactComponent.js:65
(anonymous function) @ react-social.js:143
(anonymous function) @ ?callback=jsonp_1463407624090_466&url=http%3A%2F%2F127.0.0.1%3A3000%2Fpagina%2Fcronologia-dos-acont…:1

[email protected]

ButtonGroup

I think of a ButtonGroup component that is capable of displaying all the buttons you want with just one single component. Because usually you want to share the same url with the same message at one time. So what you basically can do with a button group would be something like that:

render() {
  const url = "https://github.com/olahol/react-socia", message = "So cool!";
  const buttonsToShow = [{
       button: 'Facebook',
       style: BUTTON_WITH_COUNTER,
       appId: 'my-facebook-app-id'
    }, {
       button: 'Google',
       style: BUTTON_WITHOUT_COUNTER
    }, {
       button: 'Reddit'
    }
  ];

  return (
    <div className="btn-group">
      <ButtonGroup url={url} message={message} buttons={buttonsToShow} />
    </div>
  )
}

url and message are directly passed down to every button props since it is always the same. appId is only passed if available and needed. And there can be a button style that can display a button itself or one with a couter.

What do you guys think of that approach?

donreach.com share count API, limit of 1000 API requests per hour

We regret to inform you that due to a massive rise in popularity of our service we've had to implement a rate limit of 1000 API requests per hour. If you require more requests please contact us to discuss premium or dedicated options.

In most cases, this is not a problem.. but an issue.

Element could also be react component

I tried feeding the share buttons a React component (a custom button) rather than just the string name of a html tag.
It works perfectly. props get passed down and the component gets rendered nicely.

However react raised a PropType warning, since the validation requires a string.

warning.js:45 Warning: Failed propType: Invalid prop `element` of type `function` supplied to `FacebookButton`, expected `string`. 

This should be easy to fix by adding function to the possible PropTypes.

Structuring and ES6

How about structuring the components into separate files?

I'd go with this directory structure:

- index.js
- lib
| jsonp.js
| - Components
| | - Facebook
| | | - FacebookButton
| | | | - facebookbutton.js
| | | | - index.js
| | | - FacebookCount
| | | | - facebookcount.js
| | | | - index.js
| | - Xing
| | | - XingButton
| | | | - xingbutton.js
| | | | - index.js

.. and so on. What do you think?

The more buttons and functions, the more unmaintainable it will be with one single file in future.

It would also be nice to have different example styles for the buttons (with optional FontAwesome icons for instance). This would lead to an easier integration for new react users.

I'd also propose to switch to ES6 syntax in that step.

Remove React warnings for PropTypes and createClass

Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs

Warning: Accessing createClass via the main React package is deprecated, and will be removed in React v16.0. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class v15.* is available on npm as a temporary, drop-in replacement. For more info see https://fb.me/react-create-class

window.open(url, target)

Hi,
Is it possible to pass a prop target to define target type. I want pop up instead of new window.
I saw on the code here
if (typeof result === "object") { var url = result[0] var target = result[1] } else { var url = result var target = "_blank" } window.open(url, target);
Thanks

Truncate Twitter text automatically?

Hi,

var msg = this.props.message === "" ?
        this.props.url : this.props.message + " " + this.props.url;

The url is shortened by twitter automatically and the size is always 23, so it makes sense to automatically truncate the message with a limit of (140 - 24) I think

Media for FB and TW

Hi man,

thank you for this component! But, how works the Media for FB and TW?

If I'm trying something like this:

var media = "http://someUrl.com/imageName.png";
...
<FacebookButton url={url} media={media}>
    FB share
</FacebookButton>

nothing happen there. Can you help me, how include the image there? Thank you!

V.

facebook share button requires app id?

I chose to use this package because when I originally went through the example and implemented it, it just worked (for facebook and twitter). Now however, it is acting like it expects and facebook app id. Does this require an app id? If so, why no mention in example. If not, why am I getting the error?

React.renderToString error: react-social uses jsonp and requires a browser environment

Hi, how are you.
I´m having some trouble using this component with React.renderToString.
I get this error:

error: uncaughtException: react-social uses jsonp and requires a browser environment

from this line i guess:

[...]
  if (typeof document === "undefined" || typeof window === "undefined") {
    throw new Error("react-social uses jsonp and requires a browser environment");
  }
[...]

Is there a way to get this working?
Thanks!

TwitterButton fails on iOS

Hi, just tried using the TwitterButton component and it works fine on desktop browsers, however I see that on a iPhone it directs to a mobile.twitter.com side with the embedded message in the URL, but all I see on the phone is the Twitter Home page with the list of Tweets on the account. No compose tweet UI pops up like on Desktop.

Is this a known issue?

Twitter count

Twitter share counts are gone, they need to be added back.

share to Instagram

Hi,

I'm not sure it's even permitted by Instagram, but is there a way to share a picture to Instagram, like for Pinterest? If so it would be nice to have it

Successful share callback

The only disadvantage is that its is not possible to catch the hook when user sucessfully shares(e.g. to close modal, to make a discount...)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.