Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
key
}
}
`
const Button = ({ children, triggerLogin, densed, ...props }) => (
<button> 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])
render() {
const { children, triggerLogin, ...props } = this.props;
return (
<div>
{children}
</div>
);
}
}
export default SocialLogin(Button);