Skip to content

Commit

Permalink
fix userprofile loader and button (#618)
Browse files Browse the repository at this point in the history
* position loader

* style profile button
  • Loading branch information
OlegMoshkovich committed Feb 20, 2023
1 parent c938098 commit 144b5fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/Components/AuthNav.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import React from 'react'
import {useAuth0} from '@auth0/auth0-react'
import {CircularProgress} from '@material-ui/core'
import LoginButton from './LoginButton'
import UserProfile from './UserProfile'
import Loader from './Loader'
import {TooltipIconButton} from './Buttons'


const AuthNav = () => {
const {isLoading, isAuthenticated} = useAuth0()

if (isLoading) {
return <CircularProgress/>
return (
<TooltipIconButton
title={'Log in with GitHub'}
icon={<Loader/>}
onClick={() => {
return undefined
}}
/>
)
}

return isAuthenticated ?
<UserProfile/> :
<LoginButton/>
Expand Down
13 changes: 12 additions & 1 deletion src/Components/UserProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,18 @@ const UserProfile = ({size = 'medium'}) => {

return isAuthenticated && (
<>
<IconButton className={'no-hover'} {...bindTrigger(popupState)}>
<IconButton
className={'no-hover'}
{...bindTrigger(popupState)}
sx={{
'width': '50px',
'height': '50px',
'border': 'none',
'&.Mui-selected, &.Mui-selected:hover': {
opacity: .8,
},
}}
>
<Avatar
alt={user.name}
src={user.picture}
Expand Down

0 comments on commit 144b5fc

Please sign in to comment.