feat(auth0) add onClick prop to Button tag
This commit is contained in:
parent
ea29090eee
commit
2f495ba51c
|
@ -1,9 +1,18 @@
|
||||||
|
import { useAuth0 } from '@auth0/auth0-react';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
function LoginButton(props) {
|
function LoginButton(props) {
|
||||||
|
const { loginWithRedirect } = useAuth0()
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<button className="loginButton">Login</button>
|
<button
|
||||||
|
onClick={()=>loginWithRedirect()}
|
||||||
|
className="loginButton"
|
||||||
|
>
|
||||||
|
Login
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
)
|
||||||
};
|
}
|
||||||
|
|
||||||
export default LoginButton;
|
export default LoginButton;
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
|
import { useAuth0 } from '@auth0/auth0-react';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
function LogoutButton(props) {
|
function LogoutButton(props) {
|
||||||
|
const { loginWithRedirect } = useAuth0()
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<button className="loginButton">Logout</button>
|
<button
|
||||||
|
onClick={()=>loginWithRedirect()}
|
||||||
|
className="loginButton"
|
||||||
|
>
|
||||||
|
Logout
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
)
|
||||||
};
|
}
|
||||||
|
|
||||||
export default LogoutButton;
|
export default LogoutButton;
|
||||||
|
|
Loading…
Reference in New Issue