@@ -4,11 +4,9 @@ import classNames from 'classnames';
44import dynamic from 'next/dynamic' ;
55import { useAuthContext } from '../../contexts/AuthContext' ;
66import { ProfilePictureWithIndicator } from './ProfilePictureWithIndicator' ;
7- import { CoreIcon , SettingsIcon } from '../icons' ;
7+ import { CoreIcon , ReputationIcon , SettingsIcon } from '../icons' ;
88import { Button , ButtonSize , ButtonVariant } from '../buttons/Button' ;
99import { useInteractivePopup } from '../../hooks/utils/useInteractivePopup' ;
10- import { ReputationUserBadge } from '../ReputationUserBadge' ;
11- import { IconSize } from '../Icon' ;
1210import { ReadingStreakButton } from '../streak/ReadingStreakButton' ;
1311import { useReadingStreak } from '../../hooks/streaks' ;
1412import { walletUrl } from '../../lib/constants' ;
@@ -50,7 +48,7 @@ export default function ProfileButton({
5048 Partial < Record < QuestRewardType . Reputation | QuestRewardType . Cores , string > >
5149 > ( { } ) ;
5250 const coresCounterRef = useRef < HTMLDivElement | null > ( null ) ;
53- const reputationCounterRef = useRef < HTMLSpanElement | null > ( null ) ;
51+ const reputationCounterRef = useRef < HTMLDivElement | null > ( null ) ;
5452 const displayedBalance =
5553 typeof animatedCores === 'number'
5654 ? animatedCores
@@ -212,7 +210,6 @@ export default function ProfileButton({
212210 streak = { streak }
213211 isLoading = { isLoading }
214212 compact
215- className = "pl-4"
216213 />
217214 ) }
218215 { hasCoresAccess && (
@@ -236,41 +233,45 @@ export default function ProfileButton({
236233 tag = "a"
237234 variant = { ButtonVariant . Tertiary }
238235 size = { ButtonSize . Small }
236+ className = "!px-1.5"
239237 >
240238 { largeNumberFormat ( displayedBalance ) }
241239 </ Button >
242240 </ Link >
243241 </ div >
244242 </ Tooltip >
245243 ) }
246- < button
247- type = "button"
248- aria-label = "Profile settings"
249- className = { classNames (
250- 'focus-outline cursor-pointer items-center gap-2 border-none p-0 font-bold text-text-primary no-underline typo-subhead' ,
251- className ?? 'flex' ,
252- ) }
253- onClick = { wrapHandler ( ( ) => onUpdate ( ! isOpen ) ) }
254- >
255- < span
244+ < Tooltip content = "Reputation" >
245+ < div
256246 ref = { reputationCounterRef }
257- className = "inline-flex items-center"
258- data-reward-target = { QuestRewardType . Reputation }
247+ className = "flex origin-center justify-center will-change-transform"
259248 >
260- < ReputationUserBadge
261- className = "ml-1 !typo-subhead"
262- user = { { reputation : displayedReputation ?? 0 } }
263- iconProps = { {
264- size : IconSize . Small ,
265- } }
266- />
267- </ span >
268- < Tooltip side = "bottom" content = "Profile settings" >
269- < div className = "flex items-center" >
270- < ProfilePictureWithIndicator user = { user } />
271- </ div >
272- </ Tooltip >
273- </ button >
249+ < Button
250+ type = "button"
251+ data-reward-target = { QuestRewardType . Reputation }
252+ icon = { < ReputationIcon className = "text-accent-onion-default" /> }
253+ variant = { ButtonVariant . Tertiary }
254+ size = { ButtonSize . Small }
255+ className = "!pl-0.5 !pr-1.5"
256+ onClick = { wrapHandler ( ( ) => onUpdate ( ! isOpen ) ) }
257+ >
258+ { largeNumberFormat ( displayedReputation ?? 0 ) }
259+ </ Button >
260+ </ div >
261+ </ Tooltip >
262+ < Tooltip side = "bottom" content = "Profile settings" >
263+ < button
264+ type = "button"
265+ aria-label = "Profile settings"
266+ className = { classNames (
267+ 'focus-outline cursor-pointer items-center border-none bg-transparent p-0' ,
268+ className ?? 'flex' ,
269+ ) }
270+ onClick = { wrapHandler ( ( ) => onUpdate ( ! isOpen ) ) }
271+ >
272+ < ProfilePictureWithIndicator user = { user } />
273+ </ button >
274+ </ Tooltip >
274275 </ div >
275276 ) }
276277 { isOpen && < ProfileMenu onClose = { ( ) => onUpdate ( false ) } /> }
0 commit comments