From a150b136885cf52255b8c684e0481f9b4e947b3e Mon Sep 17 00:00:00 2001
From: Chloe <44501120+chloezxyy@users.noreply.github.com>
Date: Wed, 27 Sep 2023 13:34:45 +0800
Subject: [PATCH] fix(ui-ux): svg border for evm tokens (#4029)
* fix(ui-ux): svg border for evm tokens
* fix(ui-ux): conditional icon sizing with svg border on evm tokens
---
.../app/components/EVMLinearGradient.tsx | 28 +++++++++++++++++++
mobile-app/app/components/SummaryTitle.tsx | 15 +++++++---
.../app/components/TokenDropdownButton.tsx | 9 ++++--
.../components/icons/assets/ConvertIcon.tsx | 8 ++++--
.../SwapTokenSelectionScreen.tsx | 7 ++++-
.../screens/Portfolio/PortfolioScreen.tsx | 1 +
.../Portfolio/components/ActionButtons.tsx | 1 +
.../Portfolio/components/PortfolioCard.tsx | 17 +++++++++--
.../Portfolio/components/TokenIcon.tsx | 11 ++++++--
.../screens/ConvertConfirmationScreen.tsx | 3 +-
.../Portfolio/screens/ConvertScreen.tsx | 14 ++++++----
.../Portfolio/screens/TokenDetailScreen.tsx | 6 ++++
12 files changed, 101 insertions(+), 19 deletions(-)
create mode 100644 mobile-app/app/components/EVMLinearGradient.tsx
diff --git a/mobile-app/app/components/EVMLinearGradient.tsx b/mobile-app/app/components/EVMLinearGradient.tsx
new file mode 100644
index 0000000000..c57b6455e6
--- /dev/null
+++ b/mobile-app/app/components/EVMLinearGradient.tsx
@@ -0,0 +1,28 @@
+import { tailwind } from "@tailwind";
+import { LinearGradient } from "expo-linear-gradient";
+import { ReactElement } from "react";
+
+/* Only apply evm border color if it's an EVM Token */
+export function EVMLinearGradient({
+ children,
+ isEvmToken,
+}: {
+ children: ReactElement;
+ isEvmToken?: boolean;
+}): JSX.Element | null {
+ if (isEvmToken) {
+ return (
+
+ {children}
+
+ );
+ }
+
+ return children;
+}
diff --git a/mobile-app/app/components/SummaryTitle.tsx b/mobile-app/app/components/SummaryTitle.tsx
index c1e718f3ef..b0fba129c2 100644
--- a/mobile-app/app/components/SummaryTitle.tsx
+++ b/mobile-app/app/components/SummaryTitle.tsx
@@ -7,6 +7,7 @@ import { RandomAvatar } from "@screens/AppNavigator/screens/Portfolio/components
import { AddressType } from "@waveshq/walletkit-ui/dist/store";
import { View } from ".";
import { ThemedTextV2, ThemedViewV2 } from "./themed";
+import { EVMLinearGradient } from "./EVMLinearGradient";
interface ISummaryTitleProps {
title: string;
@@ -21,6 +22,7 @@ interface ISummaryTitleProps {
iconB?: string;
addressType?: AddressType;
amountTextStyle?: string;
+ isEvmToken?: boolean;
}
export function SummaryTitle(props: ISummaryTitleProps): JSX.Element {
@@ -47,7 +49,12 @@ export function SummaryTitle(props: ISummaryTitleProps): JSX.Element {
) : (
-
+
+
+
)}
@@ -82,7 +89,7 @@ export function SummaryTitle(props: ISummaryTitleProps): JSX.Element {
dark={tailwind("bg-mono-dark-v2-200")}
light={tailwind("bg-mono-light-v2-200")}
style={tailwind(
- "rounded-full pl-1 pr-2.5 py-1 flex flex-row items-center overflow-hidden ml-2"
+ "rounded-full pl-1 pr-2.5 py-1 flex flex-row items-center overflow-hidden ml-2",
)}
>
@@ -124,7 +131,7 @@ export function SummaryTitle(props: ISummaryTitleProps): JSX.Element {
{
"pl-1": props.addressType === AddressType.WalletAddress,
"pl-2.5": props.addressType !== AddressType.WalletAddress,
- }
+ },
)}
>
{props.addressType === AddressType.WalletAddress && (
diff --git a/mobile-app/app/components/TokenDropdownButton.tsx b/mobile-app/app/components/TokenDropdownButton.tsx
index e6b0210c4e..292b58d951 100644
--- a/mobile-app/app/components/TokenDropdownButton.tsx
+++ b/mobile-app/app/components/TokenDropdownButton.tsx
@@ -6,6 +6,7 @@ import {
import { getNativeIcon } from "@components/icons/assets";
import { tailwind } from "@tailwind";
import { translate } from "@translations";
+import { EVMLinearGradient } from "./EVMLinearGradient";
export enum TokenDropdownButtonStatus {
Active,
@@ -20,6 +21,7 @@ export function TokenDropdownButton(props: {
testID: string;
onPress?: () => void;
status: TokenDropdownButtonStatus;
+ isEvmToken?: boolean;
}): JSX.Element {
const Icon =
props.symbol !== undefined ? getNativeIcon(props.symbol) : undefined;
@@ -49,7 +51,10 @@ export function TokenDropdownButton(props: {
)}
{props.symbol !== undefined && Icon !== undefined && (
<>
-
+
+
+
+
+