How to use the react-social-login function in react-social-login

To help you get started, we’ve selected a few react-social-login examples, based on popular ways it is used in public projects.

github guandjoy / redfish / src / landing-page / src / components / authentication / AuthWithFacebook.js View on Github external
key
    }
  }
`

const Button = ({ children, triggerLogin, densed, ...props }) => (
  <button
    className={densed ? 'facebook-button-densed' : 'facebook-button'}
    onClick={() => triggerLogin()}
    {...props}
  >
    {children}
  </button>
)

const SocialButton = SocialLogin(Button)

function AuthWithFacebook(props) {
  const isBrowser = useBrowser()

  const [isAuth, setIsAuth] = useState(false)
  const [
    authWithFacebook,
    { loading: mutationLoading, error, data },
  ] = useMutation(AUTH_WITH_FACEBOOK)
  const [accessToken, setAccessToken] = useState()

  // Turn on spinner
  const client = useApolloClient()
  useEffect(() => {
    client.writeData({ data: { sending: mutationLoading || isAuth || false } })
  }, [mutationLoading, isAuth])
github yuchiu / Slack-Clone / client / src / components / common / SocialButton / SocialButton.js View on Github external
render() {
    const { children, triggerLogin, ...props } = this.props;
    return (
      <div
        onClick={triggerLogin}
        className={`social-btn social-btn--${children[1]}`}
        {...props}
      >
        {children}
      </div>
    );
  }
}

export default SocialLogin(Button);

react-social-login

React Component for Login via Social Providers

MIT
Latest version published 9 months ago

Package Health Score

67 / 100
Full package analysis

Popular react-social-login functions