Skip to content

Commit

Permalink
better offline appearance (#4783)
Browse files Browse the repository at this point in the history
  • Loading branch information
lankaukk authored Jan 22, 2024
1 parent bada0a0 commit 2073ee1
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions editor/src/components/user-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export const MultiplayerAvatar = React.memo((props: MultiplayerAvatarProps) => {
initials={props.name}
isOffline={props.isOffline}
/>
{props.isOwner ? <OwnerBadge /> : null}
{props.isOwner ? <OwnerBadge isOffline={props.isOffline} /> : null}
{props.follower ? <FollowerBadge /> : null}
</div>
</Tooltip>
Expand Down Expand Up @@ -421,15 +421,25 @@ const FollowerBadge = React.memo(() => {
})
FollowerBadge.displayName = 'FollowerBadge'

const OwnerBadge = React.memo(() => {
interface OwnerBadge {
isOffline?: boolean
}

const OwnerBadge = React.memo((props: OwnerBadge) => {
return (
<Icn
category='semantic'
type={'star'}
width={14}
height={14}
color='main'
style={{ position: 'absolute', zIndex: 1, bottom: -4, left: -4 }}
style={{
position: 'absolute',
zIndex: 1,
bottom: -4,
left: -4,
filter: props.isOffline ? 'grayscale(1)' : 'undefined',
}}
/>
)
})
Expand Down Expand Up @@ -472,6 +482,7 @@ const AvatarPicture = React.memo((props: AvatarPictureProps) => {
height: size ?? '100%',
borderRadius: '100%',
filter: props.isOffline || props.resolved ? 'grayscale(1)' : undefined,
opacity: props.isOffline ? 0.6 : 'undefined',
pointerEvents: 'none',
}}
src={url}
Expand Down

0 comments on commit 2073ee1

Please sign in to comment.