Skip to content

Commit

Permalink
fix send colors (#4718)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylarbarrera committed Mar 16, 2023
1 parent f4c59f1 commit cd252e5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
5 changes: 1 addition & 4 deletions src/components/coin-row/SendCoinRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ const BottomRow = ({

const TopRow = ({ item, name, selected }) => {
const { colors } = useTheme();
const address = item?.mainnet_address || item?.address;
const type = item?.mainnet_address ? AssetTypes.token : item?.type;

const colorForAsset = useColorForAsset({ address, type });
const colorForAsset = useColorForAsset(item);

return (
<CoinName
Expand Down
9 changes: 1 addition & 8 deletions src/components/send/SendAssetForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const FormContainer = styled(Column).attrs(
export default function SendAssetForm({
assetAmount,
buttonRenderer,
colorForAsset,
nativeAmount,
nativeCurrency,
onChangeAssetAmount,
Expand Down Expand Up @@ -87,14 +88,6 @@ export default function SendAssetForm({

const { colors } = useTheme();

const address = selected?.mainnet_address || selected?.address;
const type = selected?.mainnet_address ? AssetTypes.token : selected?.type;

let colorForAsset = useColorForAsset({ address, type });
if (isNft) {
colorForAsset = colors.appleBlue;
}

const noShadows = [[0, 0, 0, colors.transparent, 0]];
const shadows = useMemo(() => AssetRowShadow(colors), [colors]);

Expand Down
5 changes: 1 addition & 4 deletions src/screens/SendConfirmationSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,7 @@ export default function SendConfirmationSheet() {
[amountDetails.nativeAmount, nativeCurrency]
);

let color = useColorForAsset({
address: asset.mainnet_address || asset.address,
type: asset?.mainnet_address ? AssetTypes.token : asset?.type,
});
let color = useColorForAsset(asset);

if (isNft) {
color = colors.appleBlue;
Expand Down
14 changes: 3 additions & 11 deletions src/screens/SendSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,7 @@ export default function SendSheet(props) {

const isNft = selected?.type === AssetTypes.nft;

const address = selected?.mainnet_address || selected?.address;
const type = selected?.mainnet_address ? AssetTypes.token : selected?.type;
let colorForAsset = useColorForAsset(
{
address,
type,
},
null,
false,
true
);
let colorForAsset = useColorForAsset(selected, null, false, true);
if (isNft) {
colorForAsset = colors.appleBlue;
}
Expand Down Expand Up @@ -939,6 +929,7 @@ export default function SendSheet(props) {
<Container testID="send-sheet">
<SheetContainer>
<SendHeader
colorForAsset={colorForAsset}
contacts={contacts}
fromProfile={params?.fromProfile}
hideDivider={showAssetForm}
Expand Down Expand Up @@ -1019,6 +1010,7 @@ export default function SendSheet(props) {
weight="heavy"
/>
}
colorForAsset={colorForAsset}
nativeAmount={amountDetails.nativeAmount}
nativeCurrency={nativeCurrency}
nativeCurrencyInputRef={nativeCurrencyInputRef}
Expand Down

0 comments on commit cd252e5

Please sign in to comment.