Skip to content

Commit 0683466

Browse files
committed
feat: add loading state to profile image button and apply overflow hidden styling
1 parent 3308533 commit 0683466

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/assets/App.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,11 +1162,12 @@ Producthunt item
11621162
color: white;
11631163
font-size: 24px;
11641164
}
1165-
1165+
.overflowHidden {
1166+
overflow: hidden;
1167+
}
11661168
/* User */
11671169
.profileImageContainer {
11681170
position: relative;
1169-
overflow: hidden;
11701171

11711172
img {
11721173
width: 40px;

src/components/Layout/Header.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { clsx } from 'clsx'
12
import { useEffect, useState } from 'react'
23
import { BsFillBookmarksFill, BsFillGearFill, BsMoonFill } from 'react-icons/bs'
34
import { CgTab } from 'react-icons/cg'
@@ -7,7 +8,6 @@ import { Link, useLocation, useNavigate } from 'react-router-dom'
78
import { ReactComponent as AvatarPlaceholder } from 'src/assets/icons/avatar.svg'
89
import { ReactComponent as StreakIcon } from 'src/assets/icons/fire_icon.svg'
910
import { ReactComponent as HackertabLogo } from 'src/assets/logo.svg'
10-
1111
import { SearchBar } from 'src/components/Elements/SearchBar'
1212
import { UserTags } from 'src/components/Elements/UserTags'
1313
import { useAuth } from 'src/features/auth'
@@ -16,7 +16,7 @@ import { identifyUserTheme, trackDNDDisable, trackThemeSelect } from 'src/lib/an
1616
import { useUserPreferences } from 'src/stores/preferences'
1717
import { Button, CircleButton } from '../Elements'
1818
export const Header = () => {
19-
const { openAuthModal, user, isConnected } = useAuth()
19+
const { openAuthModal, user, isConnected, isConnecting } = useAuth()
2020

2121
const [themeIcon, setThemeIcon] = useState(<BsMoonFill />)
2222
const { theme, setTheme, setDNDDuration, isDNDModeActive } = useUserPreferences()
@@ -85,7 +85,8 @@ export const Header = () => {
8585
<BsFillBookmarksFill />
8686
</CircleButton>
8787
<CircleButton
88-
className="profileImageContainer"
88+
isLoading={isConnecting}
89+
className={clsx('profileImageContainer', !isConnected && 'overflowHidden')}
8990
onClick={() => {
9091
if (isConnected) {
9192
navigate('/settings/general')

0 commit comments

Comments
 (0)