Skip to content

Commit

Permalink
Profile after authentication is added
Browse files Browse the repository at this point in the history
  • Loading branch information
Rupa-Rd committed Mar 10, 2024
1 parent efd78e5 commit 1505746
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
20 changes: 20 additions & 0 deletions open-source-galaxy/src/components/Profile.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@



.profile-pic > img{
height: 50px;
width: 50px;
margin: 10px 20px 5px 5px;
border-radius: 50%;
}

@media (max-width: 1025px){

.profile-pic > img{
height: 40px;
width: 40px;
margin-right: 50px;
cursor: pointer;
border-radius: 50%;
}
}
17 changes: 17 additions & 0 deletions open-source-galaxy/src/components/Profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react'
import { useAuth0 } from '@auth0/auth0-react';
import './Profile.css';

function Profile() {
const { user, isAuthenticated, logout} = useAuth0();
return (
isAuthenticated && (
<div className='profile-pic'>
<img src={user.picture} alt={user.name} onClick={() => logout({ logoutParams: { returnTo: window.location.origin } })}/>
</div>
)

)
}

export default Profile

0 comments on commit 1505746

Please sign in to comment.