Skip to content
Permalink
Browse files

Add profile component

  • Loading branch information
ivarprudnikov committed Jan 2, 2020
1 parent e1a98de commit e17d175d08a2d736e94ad4fdb2d5355d5a69baed
Showing with 22 additions and 0 deletions.
  1. +22 −0 src/components/Profile.js
@@ -0,0 +1,22 @@
import React, { Fragment } from "react";
import { useAuth0 } from "../react-auth0-spa";

const Profile = () => {
const { loading, user } = useAuth0();

if (loading || !user) {
return <div>Loading...</div>;
}

return (
<Fragment>
<img src={user.picture} alt="Profile" />

<h2>{user.name}</h2>
<p>{user.email}</p>
<code>{JSON.stringify(user, null, 2)}</code>
</Fragment>
);
};

export default Profile;

0 comments on commit e17d175

Please sign in to comment.
You can’t perform that action at this time.