Skip to content

Commit 5113b56

Browse files
refactor(avatar): rename hitSlop variable to be more descriptive
Co-Authored-By: nitzany@wix.com <nitzany@wix.com>
1 parent 26c514f commit 5113b56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/avatar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const Avatar = forwardRef<any, AvatarProps>((props: AvatarProps, ref: React.Forw
188188
children
189189
} = themeProps;
190190

191-
const _hitSlop = useMemo(() => {
191+
const accessibleHitSlop = useMemo(() => {
192192
const hitTargetPadding = Math.max(0, (48 - size) / 2);
193193
return {
194194
top: hitTargetPadding,
@@ -357,7 +357,7 @@ const Avatar = forwardRef<any, AvatarProps>((props: AvatarProps, ref: React.Forw
357357
accessible={!_.isUndefined(onPress)}
358358
accessibilityLabel={'Avatar'}
359359
accessibilityRole={onPress ? 'button' : 'image'}
360-
hitSlop={onPress ? _hitSlop : undefined}
360+
hitSlop={onPress ? accessibleHitSlop : undefined}
361361
{...accessibilityProps}
362362
>
363363
<View testID={`${testID}.container`} style={textContainerStyle}>

0 commit comments

Comments
 (0)