Skip to content

Commit

Permalink
CP-9622: Show borders for token logos in watchlist (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
onghwan authored Dec 17, 2024
1 parent 7b2a7e5 commit 3c6511d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/core-mobile/app/components/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,19 @@ const AvatarBase: FC<AvatarBaseProps> = ({
)
}

const borderWidth = showBorder ? 0.5 : 0
const borderColor = showBorder ? '$neutral800' : 'unset'

return logoUri?.endsWith('svg') && !isContentfulImageUri(logoUri) ? (
<SvgUri
uri={logoUri}
width={size}
height={size}
style={{
borderRadius: size,
backgroundColor: backgroundColor
backgroundColor: backgroundColor,
borderWidth,
borderColor
}}
onLoad={() => setFailedToLoad(false)}
onError={() => setFailedToLoad(true)}
Expand All @@ -109,7 +114,9 @@ const AvatarBase: FC<AvatarBaseProps> = ({
borderRadius: size,
width: size,
height: size,
backgroundColor: backgroundColor
backgroundColor: backgroundColor,
borderWidth,
borderColor
}}
source={{
uri: isContentfulImageUri(logoUri)
Expand All @@ -131,6 +138,7 @@ interface TokenAvatarProps {
size?: number
testID?: string
backgroundColor?: string
showBorder?: boolean
}

const TokenAvatar: FC<TokenAvatarProps> = props => {
Expand All @@ -141,6 +149,7 @@ const TokenAvatar: FC<TokenAvatarProps> = props => {
tokenSymbol={props.symbol}
testID={props.symbol}
backgroundColor={props.backgroundColor}
showBorder={props.showBorder}
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const LeftComponent = ({
size={32}
testID={`${name}`}
backgroundColor="white"
showBorder
/>
</View>
)
Expand Down

0 comments on commit 3c6511d

Please sign in to comment.