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';
|
||||
|
||||
function LoginButton(props) {
|
||||
const { loginWithRedirect } = useAuth0()
|
||||
return (
|
||||
<div>
|
||||
<button className="loginButton">Login</button>
|
||||
<button
|
||||
onClick={()=>loginWithRedirect()}
|
||||
className="loginButton"
|
||||
>
|
||||
Login
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
export default LoginButton;
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
import { useAuth0 } from '@auth0/auth0-react';
|
||||
import React from 'react';
|
||||
|
||||
function LogoutButton(props) {
|
||||
const { loginWithRedirect } = useAuth0()
|
||||
return (
|
||||
<div>
|
||||
<button className="loginButton">Logout</button>
|
||||
<button
|
||||
onClick={()=>loginWithRedirect()}
|
||||
className="loginButton"
|
||||
>
|
||||
Logout
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
export default LogoutButton;
|
||||
|
|
Loading…
Reference in New Issue