From 7574a745d17135b33a31e3fb7da8953ea378fe4c Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 9 Sep 2025 18:40:19 +0300 Subject: Fix focus ring shapes (#9005) * fix user avis being the wrong shape * fix the fab being the wrong shape --- src/view/com/util/UserAvatar.tsx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/view/com/util/UserAvatar.tsx') diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx index e83921b0b..aa5b22bd3 100644 --- a/src/view/com/util/UserAvatar.tsx +++ b/src/view/com/util/UserAvatar.tsx @@ -1,4 +1,4 @@ -import React, {memo, useCallback, useMemo, useState} from 'react' +import {memo, useCallback, useMemo, useState} from 'react' import { Image, Pressable, @@ -363,7 +363,7 @@ let EditableUserAvatar = ({ } }, [circular, size]) - const onOpenCamera = React.useCallback(async () => { + const onOpenCamera = useCallback(async () => { if (!(await requestCameraAccessIfNeeded())) { return } @@ -377,7 +377,7 @@ let EditableUserAvatar = ({ ) }, [onSelectNewAvatar, requestCameraAccessIfNeeded]) - const onOpenLibrary = React.useCallback(async () => { + const onOpenLibrary = useCallback(async () => { if (!(await requestPhotoAccessIfNeeded())) { return } @@ -421,7 +421,7 @@ let EditableUserAvatar = ({ circular, ]) - const onRemoveAvatar = React.useCallback(() => { + const onRemoveAvatar = useCallback(() => { onSelectNewAvatar(null) }, [onSelectNewAvatar]) @@ -528,7 +528,7 @@ let PreviewableUserAvatar = ({ disableNavigation, onBeforePress, live, - ...rest + ...props }: PreviewableUserAvatarProps): React.ReactNode => { const {_} = useLingui() const queryClient = useQueryClient() @@ -557,10 +557,15 @@ let PreviewableUserAvatar = ({ moderation={moderation} type={profile.associated?.labeler ? 'labeler' : 'user'} live={status.isActive || live} - {...rest} + {...props} /> ) + const linkStyle = + props.type !== 'algo' && props.type !== 'list' + ? a.rounded_full + : {borderRadius: props.size > 32 ? 8 : 3} + return ( {disableNavigation ? ( @@ -596,7 +601,8 @@ let PreviewableUserAvatar = ({ did: profile.did, handle: profile.handle, })} - onPress={onPress}> + onPress={onPress} + style={linkStyle}> {avatarEl} )} -- cgit 1.4.1