From 9991c9ca6e282ffa936bcde13046deb6fa62ccaf Mon Sep 17 00:00:00 2001 From: Kane Thomas Date: Wed, 4 Dec 2024 20:18:52 -0500 Subject: [PATCH] fix lp badge gradient overflow and android shadows (#6296) --- src/screens/positions/LpPositionListItem.tsx | 14 ++++---- src/screens/positions/LpRangeBadge.tsx | 36 ++++++++++++++------ 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/screens/positions/LpPositionListItem.tsx b/src/screens/positions/LpPositionListItem.tsx index 37388d82f00..a82d07456c3 100644 --- a/src/screens/positions/LpPositionListItem.tsx +++ b/src/screens/positions/LpPositionListItem.tsx @@ -127,7 +127,7 @@ export const LpPositionListItem: React.FC = ({ assets, totalAssetsValue, borderColor={{ custom: 'rgba(0,0,0,0.02)' }} backgroundColor={rangeStatus === 'in_range' || rangeStatus === 'full_range' ? colors.green : colors.red} shadowColor={rangeStatus === 'in_range' || rangeStatus === 'full_range' ? colors.green : colors.red} - elevation={12} + elevation={2} shadowOpacity={IS_IOS ? 0.2 : 1} shadowRadius={6} style={{ @@ -140,13 +140,11 @@ export const LpPositionListItem: React.FC = ({ assets, totalAssetsValue, asset.quantity !== '0') - .map((underlying, index) => ({ - id: underlying.asset.asset_code, - color: underlying.asset.colors?.primary ?? underlying.asset.colors?.fallback ?? colors.black, - allocationPercentage: assetAllocations[index], - }))} + assets={assets.map((underlying, index) => ({ + id: underlying.asset.asset_code, + color: underlying.asset.colors?.primary ?? underlying.asset.colors?.fallback ?? colors.black, + allocationPercentage: assetAllocations[index], + }))} /> diff --git a/src/screens/positions/LpRangeBadge.tsx b/src/screens/positions/LpRangeBadge.tsx index d9ecbd92dd1..307ec11ddee 100644 --- a/src/screens/positions/LpRangeBadge.tsx +++ b/src/screens/positions/LpRangeBadge.tsx @@ -13,6 +13,7 @@ const MAX_ALLOCATION_PERCENTAGE = 0.75; type LpRangeBadgeProps = { assets: { + id: string; color: string; allocationPercentage: number; }[]; @@ -54,7 +55,7 @@ export const LpRangeBadge = ({ assets }: LpRangeBadgeProps) => { return ( { shadowColor={asset.color} shadowOpacity={IS_IOS ? 0.2 : 1} shadowRadius={9} + elevation={3} style={{ shadowOffset: { width: 0, height: 3 }, borderCurve: 'continuous', }} > - + + + ); })}