diff --git a/.changeset/four-colts-rhyme.md b/.changeset/four-colts-rhyme.md new file mode 100644 index 000000000..842da84fb --- /dev/null +++ b/.changeset/four-colts-rhyme.md @@ -0,0 +1,5 @@ +--- +"@exactly/mobile": patch +--- + +🚸 replace pressable icons with icon button component diff --git a/.changeset/petite-taxes-do.md b/.changeset/petite-taxes-do.md new file mode 100644 index 000000000..444919b3c --- /dev/null +++ b/.changeset/petite-taxes-do.md @@ -0,0 +1,5 @@ +--- +"@exactly/mobile": patch +--- + +✨ create icon button component diff --git a/src/components/activity/details/ActivityDetails.tsx b/src/components/activity/details/ActivityDetails.tsx index 83551a219..19cec69ee 100644 --- a/src/components/activity/details/ActivityDetails.tsx +++ b/src/components/activity/details/ActivityDetails.tsx @@ -1,6 +1,5 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useRouter } from "expo-router"; @@ -17,6 +16,7 @@ import { present } from "../../../utils/intercom"; import reportError from "../../../utils/reportError"; import ActionButton from "../../shared/ActionButton"; import GradientScrollView from "../../shared/GradientScrollView"; +import IconButton from "../../shared/IconButton"; import type { ActivityItem } from "../../../utils/queryClient"; @@ -28,7 +28,9 @@ export default function ActivityDetails() { return ( - { if (router.canGoBack()) { router.back(); @@ -36,9 +38,7 @@ export default function ActivityDetails() { router.replace("/(main)/(home)"); } }} - > - - + /> {item.type === "card" && } {item.type === "received" && } diff --git a/src/components/add-funds/AddCrypto.tsx b/src/components/add-funds/AddCrypto.tsx index 09a9f6afe..d2ef15512 100644 --- a/src/components/add-funds/AddCrypto.tsx +++ b/src/components/add-funds/AddCrypto.tsx @@ -23,6 +23,7 @@ import useAccount from "../../utils/useAccount"; import AssetLogo from "../shared/AssetLogo"; import ChainLogo from "../shared/ChainLogo"; import CopyAddressSheet from "../shared/CopyAddressSheet"; +import IconButton from "../shared/IconButton"; import Image from "../shared/Image"; import SafeView from "../shared/SafeView"; import Skeleton from "../shared/Skeleton"; @@ -74,7 +75,9 @@ export default function AddCrypto() { - { if (router.canGoBack()) { router.back(); @@ -82,9 +85,7 @@ export default function AddCrypto() { router.replace("/(main)/(home)"); } }} - > - - + /> diff --git a/src/components/add-funds/AddFunds.tsx b/src/components/add-funds/AddFunds.tsx index 5ecceaff3..ab882b9fd 100644 --- a/src/components/add-funds/AddFunds.tsx +++ b/src/components/add-funds/AddFunds.tsx @@ -1,6 +1,5 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useLocalSearchParams, useRouter } from "expo-router"; @@ -21,6 +20,7 @@ import queryClient, { type AuthMethod } from "../../utils/queryClient"; import reportError from "../../utils/reportError"; import { getKYCStatus, getRampProviders } from "../../utils/server"; import ChainLogo from "../shared/ChainLogo"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Skeleton from "../shared/Skeleton"; import Text from "../shared/Text"; @@ -96,7 +96,9 @@ export default function AddFunds() { - { if (type === "crypto" || type === "fiat") { if (router.canGoBack()) { @@ -108,19 +110,17 @@ export default function AddFunds() { router.replace("/(main)/(home)"); } }} - > - - + /> {t(type === "crypto" ? "Cryptocurrencies" : type === "fiat" ? "Bank transfers" : "Add Funds")} - { presentArticle("8950801").catch(reportError); }} - > - - + /> diff --git a/src/components/add-funds/Bridge.tsx b/src/components/add-funds/Bridge.tsx index 0ad0693c5..545c69478 100644 --- a/src/components/add-funds/Bridge.tsx +++ b/src/components/add-funds/Bridge.tsx @@ -39,6 +39,7 @@ import ownerConfig from "../../utils/wagmi/owner"; import AssetLogo from "../shared/AssetLogo"; import ChainLogo from "../shared/ChainLogo"; import GradientScrollView from "../shared/GradientScrollView"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Skeleton from "../shared/Skeleton"; import ExaSpinner from "../shared/Spinner"; @@ -475,7 +476,9 @@ export default function Bridge() { - { if (!isPending) { setSourceAmount(0n); @@ -485,9 +488,7 @@ export default function Bridge() { } router.dismissTo("/activity"); }} - > - - + /> - { if (router.canGoBack()) { router.back(); @@ -580,19 +583,17 @@ export default function Bridge() { router.replace("/(main)/(home)"); } }} - > - - + /> {t("Add funds")} - { openBrowser("https://li.fi/").catch(reportError); // TODO replace with article }} - > - - + /> diff --git a/src/components/add-funds/Fees.tsx b/src/components/add-funds/Fees.tsx index e1072e113..e536d39c8 100644 --- a/src/components/add-funds/Fees.tsx +++ b/src/components/add-funds/Fees.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useRef, useState } from "react"; import { Trans, useTranslation } from "react-i18next"; -import { Platform, Pressable } from "react-native"; +import { Platform } from "react-native"; import { WebView } from "react-native-webview"; import { Redirect, useLocalSearchParams, useRouter } from "expo-router"; @@ -21,6 +21,7 @@ import openBrowser from "../../utils/openBrowser"; import { APIError } from "../../utils/queryClient"; import reportError from "../../utils/reportError"; import { getKYCStatus, getRampProviders } from "../../utils/server"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; import Text from "../shared/Text"; @@ -131,9 +132,7 @@ export default function Fees() { return ( - setTOSLink(undefined)}> - - + setTOSLink(undefined)} /> - { if (router.canGoBack()) { router.back(); @@ -160,9 +161,7 @@ export default function Fees() { router.replace("/(main)/(home)"); } }} - > - - + /> diff --git a/src/components/add-funds/KYC.tsx b/src/components/add-funds/KYC.tsx index bb4859c88..71d96993b 100644 --- a/src/components/add-funds/KYC.tsx +++ b/src/components/add-funds/KYC.tsx @@ -1,6 +1,5 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { Redirect, useLocalSearchParams, useRouter } from "expo-router"; @@ -17,6 +16,7 @@ import { isValidCurrency } from "../../utils/currencies"; import { startAddressKYC, startMantecaKYC } from "../../utils/persona"; import queryClient from "../../utils/queryClient"; import reportError from "../../utils/reportError"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; import Text from "../shared/Text"; @@ -81,7 +81,9 @@ export default function KYC() { - { queryClient.removeQueries({ queryKey: ["ramp", "kyc-tokens", provider] }); if (router.canGoBack()) { @@ -90,9 +92,7 @@ export default function KYC() { router.replace("/(main)/(home)"); } }} - > - - + /> diff --git a/src/components/add-funds/Onboard.tsx b/src/components/add-funds/Onboard.tsx index 8407546c4..c7f5638d9 100644 --- a/src/components/add-funds/Onboard.tsx +++ b/src/components/add-funds/Onboard.tsx @@ -1,6 +1,5 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { Redirect, useLocalSearchParams, useRouter } from "expo-router"; @@ -20,6 +19,7 @@ import USD from "../../assets/images/usd.svg"; import USDC from "../../assets/images/usdc.svg"; import USDT from "../../assets/images/usdt.svg"; import { isValidCurrency } from "../../utils/currencies"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; import Text from "../shared/Text"; @@ -50,7 +50,9 @@ export default function Onboard() { - { if (router.canGoBack()) { router.back(); @@ -58,9 +60,7 @@ export default function Onboard() { router.replace("/(main)/(home)"); } }} - > - - + /> diff --git a/src/components/add-funds/Ramp.tsx b/src/components/add-funds/Ramp.tsx index 4ae4624ed..699750772 100644 --- a/src/components/add-funds/Ramp.tsx +++ b/src/components/add-funds/Ramp.tsx @@ -21,6 +21,7 @@ import { isValidCurrency, fees as rampFees } from "../../utils/currencies"; import reportError from "../../utils/reportError"; import { getRampProviders, getRampQuote } from "../../utils/server"; import Button from "../shared/Button"; +import IconButton from "../shared/IconButton"; import InfoAlert from "../shared/InfoAlert"; import ModalSheet from "../shared/ModalSheet"; import SafeView from "../shared/SafeView"; @@ -122,7 +123,9 @@ export default function Ramp() { - { if (router.canGoBack()) { router.back(); @@ -130,9 +133,7 @@ export default function Ramp() { router.replace("/(main)/add-funds"); } }} - > - - + /> {deposits.length > 0 ? t("{{currency}} via {{methods}}", { @@ -350,6 +351,7 @@ function DepositCard({ deposit, isLoading, copyToClipboard }: DepositCardPropert } function DetailRow({ label, value, isLoading, onCopy }: DetailRowProperties) { + const { t } = useTranslation(); return ( @@ -360,9 +362,14 @@ function DetailRow({ label, value, isLoading, onCopy }: DetailRowProperties) { {isLoading || !value ? : value} - - - + ); } diff --git a/src/components/auth/Passkeys.tsx b/src/components/auth/Passkeys.tsx index 2c85db16c..7fae00b66 100644 --- a/src/components/auth/Passkeys.tsx +++ b/src/components/auth/Passkeys.tsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; import { Trans, useTranslation } from "react-i18next"; -import { Pressable, StyleSheet } from "react-native"; +import { StyleSheet } from "react-native"; import { useRouter } from "expo-router"; @@ -17,6 +17,7 @@ import useAuth from "../../utils/useAuth"; import ActionButton from "../shared/ActionButton"; import ConnectSheet from "../shared/ConnectSheet"; import ErrorDialog from "../shared/ErrorDialog"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Text from "../shared/Text"; import View from "../shared/View"; @@ -36,7 +37,11 @@ export default function Passkeys() { - { if (router.canGoBack()) { router.back(); @@ -44,9 +49,7 @@ export default function Passkeys() { router.replace("/(auth)"); } }} - > - - + /> diff --git a/src/components/benefits/BenefitSheet.tsx b/src/components/benefits/BenefitSheet.tsx index f444d9310..5a1fff26e 100644 --- a/src/components/benefits/BenefitSheet.tsx +++ b/src/components/benefits/BenefitSheet.tsx @@ -12,6 +12,7 @@ import { useQuery } from "@tanstack/react-query"; import openBrowser from "../../utils/openBrowser"; import reportError from "../../utils/reportError"; +import IconButton from "../shared/IconButton"; import ModalSheet from "../shared/ModalSheet"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; @@ -61,9 +62,7 @@ export default function BenefitSheet({ benefit, open, onClose }: BenefitSheetPro backgroundColor="$backgroundSoft" > - - - + diff --git a/src/components/card/Card.tsx b/src/components/card/Card.tsx index f33abe129..c524a808a 100644 --- a/src/components/card/Card.tsx +++ b/src/components/card/Card.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from "react"; import { Trans, useTranslation } from "react-i18next"; -import { Pressable, RefreshControl } from "react-native"; +import { RefreshControl } from "react-native"; import { useRouter } from "expo-router"; @@ -37,6 +37,7 @@ import useAccount from "../../utils/useAccount"; import useAsset from "../../utils/useAsset"; import useMarkets from "../../utils/useMarkets"; import useTabPress from "../../utils/useTabPress"; +import IconButton from "../shared/IconButton"; import InfoAlert from "../shared/InfoAlert"; import LatestActivity from "../shared/LatestActivity"; import PluginUpgrade from "../shared/PluginUpgrade"; @@ -260,27 +261,22 @@ export default function Card() { {t("My Exa Card")} - { queryClient.setQueryData(["settings", "sensitive"], !hidden); }} - hitSlop={15} - > - {hidden ? ( - - ) : ( - - )} - - + { presentArticle("10022626").catch(reportError); }} - hitSlop={15} - > - - + /> {!isPendingKYC && (usdBalance === 0n || !isKYCApproved) && ( diff --git a/src/components/card/CardDisclaimer.tsx b/src/components/card/CardDisclaimer.tsx index 02eb64c76..557cf559a 100644 --- a/src/components/card/CardDisclaimer.tsx +++ b/src/components/card/CardDisclaimer.tsx @@ -11,6 +11,7 @@ import { presentArticle } from "../../utils/intercom"; import openBrowser from "../../utils/openBrowser"; import reportError from "../../utils/reportError"; import Button from "../shared/Button"; +import IconButton from "../shared/IconButton"; import ModalSheet from "../shared/ModalSheet"; import SafeView from "../shared/SafeView"; import Text from "../shared/Text"; @@ -30,9 +31,7 @@ export default function CardDisclaimer({ - - - + diff --git a/src/components/card/DismissableAlert.tsx b/src/components/card/DismissableAlert.tsx index ae2dedde7..84369994e 100644 --- a/src/components/card/DismissableAlert.tsx +++ b/src/components/card/DismissableAlert.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { useTranslation } from "react-i18next"; import { Pressable } from "react-native"; import { Info, X } from "@tamagui/lucide-icons"; @@ -8,6 +9,7 @@ import Text from "../shared/Text"; import View from "../shared/View"; export default function DismissableAlert({ text, onDismiss }: { onDismiss: () => void; text: string }) { + const { t } = useTranslation(); return ( {text} - - - + + ({ opacity: pressed ? 0.7 : 1 })} + > + + + diff --git a/src/components/card/VerificationFailure.tsx b/src/components/card/VerificationFailure.tsx index 7e023a5df..532070671 100644 --- a/src/components/card/VerificationFailure.tsx +++ b/src/components/card/VerificationFailure.tsx @@ -1,6 +1,5 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { ArrowRight, X } from "@tamagui/lucide-icons"; import { ScrollView, YStack } from "tamagui"; @@ -9,6 +8,7 @@ import VerifyIdentity from "../../assets/images/verify-identity.svg"; import { present } from "../../utils/intercom"; import reportError from "../../utils/reportError"; import Button from "../shared/Button"; +import IconButton from "../shared/IconButton"; import ModalSheet from "../shared/ModalSheet"; import SafeView from "../shared/SafeView"; import Text from "../shared/Text"; @@ -20,9 +20,7 @@ export default function VerificationFailure({ open, onClose }: { onClose: () => - - - + diff --git a/src/components/defi/ConnectionSheet.tsx b/src/components/defi/ConnectionSheet.tsx index 305425f06..db4d92fcf 100644 --- a/src/components/defi/ConnectionSheet.tsx +++ b/src/components/defi/ConnectionSheet.tsx @@ -1,10 +1,11 @@ import React, { useState } from "react"; -import { Pressable } from "react-native"; +import { useTranslation } from "react-i18next"; import { ArrowRight, Check, Info, X } from "@tamagui/lucide-icons"; import { XStack, YStack } from "tamagui"; import Connect from "../../assets/images/connect.svg"; +import IconButton from "../shared/IconButton"; import ModalSheet from "../shared/ModalSheet"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; @@ -29,6 +30,7 @@ export default function ConnectionSheet({ title: string; }) { const [acknowledged, setAcknowledged] = useState(true); + const { t } = useTranslation(); return ( - - - + diff --git a/src/components/defi/DeFi.tsx b/src/components/defi/DeFi.tsx index ebdd11650..70bb96620 100644 --- a/src/components/defi/DeFi.tsx +++ b/src/components/defi/DeFi.tsx @@ -1,6 +1,5 @@ import React, { useRef, useState } from "react"; import { Trans, useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useRouter } from "expo-router"; @@ -21,6 +20,7 @@ import queryClient from "../../utils/queryClient"; import reportError from "../../utils/reportError"; import useAccount from "../../utils/useAccount"; import useTabPress from "../../utils/useTabPress"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Text from "../shared/Text"; @@ -48,13 +48,14 @@ export default function DeFi() { {t("DeFi")} - { setAboutDefiSheetOpen(true); }} - > - - + /> void; ope backgroundColor="$backgroundSoft" > - - - + diff --git a/src/components/getting-started/GettingStarted.tsx b/src/components/getting-started/GettingStarted.tsx index e71e94890..493e4ee93 100644 --- a/src/components/getting-started/GettingStarted.tsx +++ b/src/components/getting-started/GettingStarted.tsx @@ -1,6 +1,5 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useRouter } from "expo-router"; @@ -17,6 +16,7 @@ import useAccount from "../../utils/useAccount"; import useBeginKYC from "../../utils/useBeginKYC"; import useOnboardingSteps from "../../utils/useOnboardingSteps"; import ActionButton from "../shared/ActionButton"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Text from "../shared/Text"; import View from "../shared/View"; @@ -48,7 +48,8 @@ export default function GettingStarted() { - { if (router.canGoBack()) { @@ -57,9 +58,7 @@ export default function GettingStarted() { router.replace("/(main)/(home)"); } }} - > - - + /> {t("Getting started")} diff --git a/src/components/home/CreditLimitSheet.tsx b/src/components/home/CreditLimitSheet.tsx index 541bb4275..08bfe67e6 100644 --- a/src/components/home/CreditLimitSheet.tsx +++ b/src/components/home/CreditLimitSheet.tsx @@ -8,6 +8,7 @@ import { XStack, YStack } from "tamagui"; import { presentArticle } from "../../utils/intercom"; import reportError from "../../utils/reportError"; import Button from "../shared/Button"; +import IconButton from "../shared/IconButton"; import ModalSheet from "../shared/ModalSheet"; import Text from "../shared/Text"; @@ -28,9 +29,7 @@ export default function CreditLimitSheet({ onClose, open }: { onClose: () => voi {t("Credit limit")} - - - + diff --git a/src/components/home/InstallmentsSheet.tsx b/src/components/home/InstallmentsSheet.tsx index 7734843ec..d31c13c3e 100644 --- a/src/components/home/InstallmentsSheet.tsx +++ b/src/components/home/InstallmentsSheet.tsx @@ -13,6 +13,7 @@ import MAX_INSTALLMENTS from "@exactly/common/MAX_INSTALLMENTS"; import reportError from "../../utils/reportError"; import useInstallmentRates from "../../utils/useInstallmentRates"; +import IconButton from "../shared/IconButton"; import ModalSheet from "../shared/ModalSheet"; import SafeView from "../shared/SafeView"; import Skeleton from "../shared/Skeleton"; @@ -60,9 +61,7 @@ export default function InstallmentsSheet({ {t("Set installments")} - - - + {t( diff --git a/src/components/home/PayModeSheet.tsx b/src/components/home/PayModeSheet.tsx index d6df27bae..be6b1b999 100644 --- a/src/components/home/PayModeSheet.tsx +++ b/src/components/home/PayModeSheet.tsx @@ -10,6 +10,7 @@ import MAX_INSTALLMENTS from "@exactly/common/MAX_INSTALLMENTS"; import { presentArticle } from "../../utils/intercom"; import reportError from "../../utils/reportError"; import Button from "../shared/Button"; +import IconButton from "../shared/IconButton"; import ModalSheet from "../shared/ModalSheet"; import Text from "../shared/Text"; @@ -30,9 +31,7 @@ export default function PayModeSheet({ onClose, open }: { onClose: () => void; o {t("Exa Card pay mode")} - - - + {t("Change the pay mode before each purchase and pay how you want.")} diff --git a/src/components/home/Portfolio.tsx b/src/components/home/Portfolio.tsx index 82fd0b536..27c736551 100644 --- a/src/components/home/Portfolio.tsx +++ b/src/components/home/Portfolio.tsx @@ -1,6 +1,6 @@ import React from "react"; import { Trans, useTranslation } from "react-i18next"; -import { Pressable, RefreshControl } from "react-native"; +import { RefreshControl } from "react-native"; import { useRouter } from "expo-router"; @@ -14,6 +14,7 @@ import reportError from "../../utils/reportError"; import useAccount from "../../utils/useAccount"; import useMarkets from "../../utils/useMarkets"; import usePortfolio from "../../utils/usePortfolio"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Text from "../shared/Text"; import View from "../shared/View"; @@ -42,7 +43,8 @@ export default function Portfolio() { justifyContent="space-between" alignItems="center" > - { if (router.canGoBack()) { @@ -51,16 +53,14 @@ export default function Portfolio() { router.replace("/(main)/(home)"); } }} - > - - - + { presentArticle("10985188").catch(reportError); }} - > - - + /> v {t("Spending limit")} - - - + diff --git a/src/components/home/VisaSignatureSheet.tsx b/src/components/home/VisaSignatureSheet.tsx index 108b37c0c..c0e4ce6dd 100644 --- a/src/components/home/VisaSignatureSheet.tsx +++ b/src/components/home/VisaSignatureSheet.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useState } from "react"; import { useTranslation } from "react-i18next"; -import { Platform, Pressable } from "react-native"; +import { Platform } from "react-native"; import { SvgUri } from "react-native-svg"; import { useRouter } from "expo-router"; @@ -15,6 +15,7 @@ import SignatureCard from "../../assets/images/signature-full.svg"; import queryClient from "../../utils/queryClient"; import reportError from "../../utils/reportError"; import { setCardStatus } from "../../utils/server"; +import IconButton from "../shared/IconButton"; import ModalSheet from "../shared/ModalSheet"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; @@ -73,9 +74,7 @@ export default function VisaSignatureSheet({ open, onClose }: { onClose: () => v - - - + void; open: boolean }) { const { data: step } = useQuery({ queryKey: ["card-upgrade"] }); + const { t } = useTranslation(); return ( voi backgroundColor="$backgroundSoft" > - - - + {step === undefined ? ( diff --git a/src/components/loans/Amount.tsx b/src/components/loans/Amount.tsx index 9fdb18a26..107762f6b 100644 --- a/src/components/loans/Amount.tsx +++ b/src/components/loans/Amount.tsx @@ -1,6 +1,5 @@ import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useRouter } from "expo-router"; @@ -18,6 +17,7 @@ import reportError from "../../utils/reportError"; import useAccount from "../../utils/useAccount"; import useAsset from "../../utils/useAsset"; import useMarkets from "../../utils/useMarkets"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; import Text from "../shared/Text"; @@ -62,7 +62,9 @@ export default function Amount() { justifyContent="space-between" alignItems="center" > - { queryClient.setQueryData(["loan"], (old) => ({ ...old, amount: undefined })); if (router.canGoBack()) { @@ -72,16 +74,14 @@ export default function Amount() { queryClient.resetQueries({ queryKey: ["loan"] }).catch(reportError); router.replace("/loan"); }} - > - - - + { presentArticle("11541409").catch(reportError); }} - > - - + /> - { presentArticle("11550408").catch(reportError); }} - > - - + /> )} diff --git a/src/components/loans/Asset.tsx b/src/components/loans/Asset.tsx index 34fe60aee..e7e809aeb 100644 --- a/src/components/loans/Asset.tsx +++ b/src/components/loans/Asset.tsx @@ -1,6 +1,5 @@ import React, { useState } from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useRouter } from "expo-router"; @@ -12,6 +11,7 @@ import queryClient, { type Loan } from "../../utils/queryClient"; import reportError from "../../utils/reportError"; import useMarkets from "../../utils/useMarkets"; import AssetLogo from "../shared/AssetLogo"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; import Text from "../shared/Text"; @@ -34,7 +34,9 @@ export default function Asset() { justifyContent="space-between" alignItems="center" > - { if (router.canGoBack()) { router.back(); @@ -42,16 +44,14 @@ export default function Asset() { } router.replace("/loan"); }} - > - - - + { presentArticle("11541409").catch(reportError); }} - > - - + /> - { if (router.canGoBack()) { router.back(); @@ -54,16 +56,14 @@ export default function Installments() { } router.replace("/loan/amount"); }} - > - - - + { presentArticle("11541409").catch(reportError); }} - > - - + /> - { if (router.canGoBack()) { router.back(); @@ -58,19 +61,18 @@ export default function Loans() { router.replace("/defi"); } }} - > - - + /> {t("Exactly Protocol")} - { presentArticle("11541409").catch(reportError); }} - > - - + /> {t( diff --git a/src/components/loans/Maturity.tsx b/src/components/loans/Maturity.tsx index 7f4b2e194..c8c0ba48d 100644 --- a/src/components/loans/Maturity.tsx +++ b/src/components/loans/Maturity.tsx @@ -1,6 +1,5 @@ import React, { useEffect } from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useRouter } from "expo-router"; @@ -18,6 +17,7 @@ import queryClient from "../../utils/queryClient"; import reportError from "../../utils/reportError"; import useAccount from "../../utils/useAccount"; import useMarkets from "../../utils/useMarkets"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; import Text from "../shared/Text"; @@ -54,7 +54,9 @@ export default function Maturity() { justifyContent="space-between" alignItems="center" > - { queryClient.setQueryData(["loan"], (old) => ({ ...old, maturity: undefined })); if (router.canGoBack()) { @@ -63,16 +65,14 @@ export default function Maturity() { } router.replace("/loan"); }} - > - - - + { presentArticle("11541409").catch(reportError); }} - > - - + /> - { queryClient.setQueryData(["loan"], (old) => ({ ...old, receiver: undefined })); if (router.canGoBack()) { @@ -87,16 +89,14 @@ export default function Receiver() { } router.replace("/loan/installments"); }} - > - - - + { presentArticle("11541409").catch(reportError); }} - > - - + /> - { if (router.canGoBack()) { router.back(); @@ -218,16 +220,14 @@ export default function Review() { } router.replace("/loan/receiver"); }} - > - - - + { presentArticle("11541409").catch(reportError); }} - > - - + /> - { if (error && router.canGoBack()) { router.back(); @@ -409,9 +411,7 @@ export default function Review() { } router.dismissTo("/activity"); }} - > - - + /> {t("Payments")} - { queryClient.setQueryData(["settings", "sensitive"], !hidden); }} - hitSlop={15} - > - {hidden ? : } - + /> {t("Total outstanding")} - - - + @@ -429,9 +433,13 @@ function FirstMaturityCard({ ) : null} - - - + diff --git a/src/components/pay/PaymentSheet.tsx b/src/components/pay/PaymentSheet.tsx index 230462960..e46693678 100644 --- a/src/components/pay/PaymentSheet.tsx +++ b/src/components/pay/PaymentSheet.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useLocalSearchParams, useRouter } from "expo-router"; @@ -25,6 +24,7 @@ import reportError from "../../utils/reportError"; import useAccount from "../../utils/useAccount"; import useAsset from "../../utils/useAsset"; import Amount from "../shared/Amount"; +import IconButton from "../shared/IconButton"; import InfoSheet from "../shared/InfoSheet"; import ModalSheet from "../shared/ModalSheet"; import Button from "../shared/StyledButton"; @@ -325,9 +325,13 @@ function DetailsView({ )} - - - + diff --git a/src/components/pay/Repay.tsx b/src/components/pay/Repay.tsx index 81ae441dd..71611b283 100644 --- a/src/components/pay/Repay.tsx +++ b/src/components/pay/Repay.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useEffect, useMemo, useReducer, useState } from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useLocalSearchParams, useRouter } from "expo-router"; @@ -54,6 +53,7 @@ import useSimulateProposal from "../../utils/useSimulateProposal"; import exa from "../../utils/wagmi/exa"; import AssetLogo from "../shared/AssetLogo"; import Failure from "../shared/Failure"; +import IconButton from "../shared/IconButton"; import Pending from "../shared/Pending"; import Skeleton from "../shared/Skeleton"; import Success from "../shared/Success"; @@ -541,7 +541,9 @@ export default function Repay() { - { if (router.canGoBack()) { router.back(); @@ -549,9 +551,7 @@ export default function Repay() { router.replace("/(main)/(home)"); } }} - > - - + /> {t("Pay due {{date}}", { date: dueDateFormatted })} diff --git a/src/components/roll-debt/RollDebt.tsx b/src/components/roll-debt/RollDebt.tsx index 319f1a800..449c9b39b 100644 --- a/src/components/roll-debt/RollDebt.tsx +++ b/src/components/roll-debt/RollDebt.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useMemo } from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useLocalSearchParams, useRouter } from "expo-router"; @@ -21,6 +20,7 @@ import { import ProposalType from "@exactly/common/ProposalType"; import { MATURITY_INTERVAL, WAD } from "@exactly/lib"; +import IconButton from "../../components/shared/IconButton"; import SafeView from "../../components/shared/SafeView"; import Text from "../../components/shared/Text"; import View from "../../components/shared/View"; @@ -84,7 +84,8 @@ export default function Pay() { - { if (router.canGoBack()) { @@ -93,9 +94,7 @@ export default function Pay() { router.replace("/(main)/(home)"); } }} - > - - + /> - { if (router.canGoBack()) { router.back(); @@ -245,9 +248,7 @@ export default function Amount() { router.replace("/send-funds/asset"); } }} - > - - + /> {t("Enter amount")} @@ -382,14 +383,13 @@ export default function Amount() { - { router.dismissTo("/activity"); }} - > - - + /> - { if (router.canGoBack()) { router.back(); @@ -180,9 +183,7 @@ export default function QR() { router.replace("/send-funds"); } }} - > - - + /> ); diff --git a/src/components/send-funds/Receiver.tsx b/src/components/send-funds/Receiver.tsx index 6a1f9c1eb..50b487c65 100644 --- a/src/components/send-funds/Receiver.tsx +++ b/src/components/send-funds/Receiver.tsx @@ -1,6 +1,5 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useLocalSearchParams, useRouter } from "expo-router"; @@ -19,6 +18,7 @@ import RecentContacts from "./RecentContacts"; import { presentArticle } from "../../utils/intercom"; import queryClient from "../../utils/queryClient"; import reportError from "../../utils/reportError"; +import IconButton from "../shared/IconButton"; import Input from "../shared/Input"; import SafeView from "../shared/SafeView"; import Button from "../shared/StyledButton"; @@ -57,7 +57,8 @@ export default function ReceiverSelection() { - { queryClient.setQueryData(["withdrawal"], { receiver: undefined, market: undefined, amount: 0n }); @@ -67,9 +68,7 @@ export default function ReceiverSelection() { router.replace("/(main)/(home)"); } }} - > - - + /> {t("Send to")} diff --git a/src/components/settings/Settings.tsx b/src/components/settings/Settings.tsx index 857027120..672f5242d 100644 --- a/src/components/settings/Settings.tsx +++ b/src/components/settings/Settings.tsx @@ -17,6 +17,7 @@ import { logout as logoutOnesignal } from "../../utils/onesignal"; import queryClient from "../../utils/queryClient"; import reportError from "../../utils/reportError"; import useAccount from "../../utils/useAccount"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Text from "../shared/Text"; import View from "../shared/View"; @@ -32,7 +33,8 @@ export default function Settings() { - { if (router.canGoBack()) { @@ -41,9 +43,7 @@ export default function Settings() { router.replace("/(main)/(home)"); } }} - > - - + /> {t("Settings")} diff --git a/src/components/shared/Failure.tsx b/src/components/shared/Failure.tsx index e685ba388..f773eecef 100644 --- a/src/components/shared/Failure.tsx +++ b/src/components/shared/Failure.tsx @@ -8,6 +8,7 @@ import { Square, XStack, YStack } from "tamagui"; import { marketUSDCAddress } from "@exactly/common/generated/chain"; import GradientScrollView from "./GradientScrollView"; +import IconButton from "./IconButton"; import SafeView from "./SafeView"; import AssetLogo from "../shared/AssetLogo"; import Text from "../shared/Text"; @@ -40,9 +41,7 @@ export default function Failure({ - - - + diff --git a/src/components/shared/IconButton.tsx b/src/components/shared/IconButton.tsx new file mode 100644 index 000000000..09d5c6661 --- /dev/null +++ b/src/components/shared/IconButton.tsx @@ -0,0 +1,33 @@ +import type { ComponentPropsWithoutRef, ComponentType } from "react"; +import React from "react"; + +import type { ArrowRight } from "@tamagui/lucide-icons"; +import { Stack, styled } from "tamagui"; + +export default function IconButton({ + icon: Icon, + color = "$uiNeutralPrimary", + size = 24, + ...properties +}: ComponentPropsWithoutRef & { + color?: string; + icon: ComponentType>; + size?: number; +}) { + return ( + + + + ); +} + +const Frame = styled(Stack, { + alignItems: "center", + justifyContent: "center", + minWidth: 48, + minHeight: 48, + margin: -12, + cursor: "pointer", + pressStyle: { opacity: 0.7 }, + variants: { disabled: { true: { opacity: 0.5, cursor: "default" } } } as const, +}); diff --git a/src/components/shared/Pending.tsx b/src/components/shared/Pending.tsx index 41224dc6c..670424b30 100644 --- a/src/components/shared/Pending.tsx +++ b/src/components/shared/Pending.tsx @@ -1,6 +1,5 @@ import React, { useMemo } from "react"; import { useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { X } from "@tamagui/lucide-icons"; import { Square, XStack, YStack } from "tamagui"; @@ -8,6 +7,7 @@ import { Square, XStack, YStack } from "tamagui"; import { marketUSDCAddress } from "@exactly/common/generated/chain"; import GradientScrollView from "./GradientScrollView"; +import IconButton from "./IconButton"; import AssetLogo from "../shared/AssetLogo"; import ExaSpinner from "../shared/Spinner"; import Text from "../shared/Text"; @@ -40,9 +40,7 @@ export default function Pending({ - - - + diff --git a/src/components/shared/ProfileHeader.tsx b/src/components/shared/ProfileHeader.tsx index 39f7a116a..3bc53bb21 100644 --- a/src/components/shared/ProfileHeader.tsx +++ b/src/components/shared/ProfileHeader.tsx @@ -13,6 +13,7 @@ import shortenHex from "@exactly/common/shortenHex"; import Blocky from "./Blocky"; import CopyAddressSheet from "./CopyAddressSheet"; +import IconButton from "./IconButton"; import StatusIndicator from "./StatusIndicator"; import queryClient from "../../utils/queryClient"; import reportError from "../../utils/reportError"; @@ -62,9 +63,12 @@ export default function ProfileHeader() { )} - - {hidden ? : } - + {count > 0 && ( )} - { router.push("/settings"); }} - hitSlop={15} - > - - + /> - - - + - - - + diff --git a/src/components/swaps/Pending.tsx b/src/components/swaps/Pending.tsx index e9aa77234..2df637396 100644 --- a/src/components/swaps/Pending.tsx +++ b/src/components/swaps/Pending.tsx @@ -1,6 +1,5 @@ import React from "react"; import { Trans, useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { LinearGradient } from "expo-linear-gradient"; @@ -10,6 +9,7 @@ import { ScrollView, Square, styled, useTheme, XStack, YStack } from "tamagui"; import { formatUnits } from "viem"; import AssetLogo from "../shared/AssetLogo"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import ExaSpinner from "../shared/Spinner"; import Text from "../shared/Text"; @@ -36,6 +36,7 @@ export default function Pending({ }) { const theme = useTheme(); const { + t, i18n: { language }, } = useTranslation(); return ( @@ -60,9 +61,7 @@ export default function Pending({ > - - - + diff --git a/src/components/swaps/Success.tsx b/src/components/swaps/Success.tsx index 5c9cf362a..5f6d0fd82 100644 --- a/src/components/swaps/Success.tsx +++ b/src/components/swaps/Success.tsx @@ -14,6 +14,7 @@ import queryClient from "../../utils/queryClient"; import reportError from "../../utils/reportError"; import AssetLogo from "../shared/AssetLogo"; import Button from "../shared/Button"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import ExaSpinner from "../shared/Spinner"; import Text from "../shared/Text"; @@ -71,9 +72,7 @@ export default function Success({ > - - - + diff --git a/src/components/swaps/Swaps.tsx b/src/components/swaps/Swaps.tsx index 232059312..723244a61 100644 --- a/src/components/swaps/Swaps.tsx +++ b/src/components/swaps/Swaps.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useEffect, useMemo, useRef, useState, type RefObject } from "react"; import { Trans, useTranslation } from "react-i18next"; -import { Pressable } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { router } from "expo-router"; @@ -35,6 +34,7 @@ import useMarkets from "../../utils/useMarkets"; import usePortfolio from "../../utils/usePortfolio"; import useSimulateProposal from "../../utils/useSimulateProposal"; import Button from "../shared/Button"; +import IconButton from "../shared/IconButton"; import SafeView from "../shared/SafeView"; import Text from "../shared/Text"; import View from "../shared/View"; @@ -375,7 +375,8 @@ export default function Swaps() { justifyContent="space-between" alignItems="center" > - { if (router.canGoBack()) { @@ -384,19 +385,17 @@ export default function Swaps() { router.replace("/(main)/(home)/defi"); } }} - > - - + /> {t("Swaps")} - { presentArticle("11757863").catch(reportError); }} - > - - + /> diff --git a/src/i18n/es.json b/src/i18n/es.json index 18628273d..e2cc7af35 100644 --- a/src/i18n/es.json +++ b/src/i18n/es.json @@ -76,6 +76,7 @@ "Available for {{count}} installments or less_other": "Disponible para {{count}} cuotas o menos", "Available for repayment": "Disponible para el pago", "Available funding": "Financiamiento disponible", + "Available funding info": "Información de financiamiento disponible", "Available in 200+ countries and regions.": "Disponible en más de 200 países y regiones.", "Available limit: {{asset}}": "Límite disponible: {{asset}}", "Available:": "Disponible:", @@ -179,6 +180,7 @@ "Destination network": "Red de destino", "Destination": "Destino", "Details": "Detalles", + "Dismiss": "Descartar", "Disconnect from {{name}}": "Desconectarte de {{name}}", "Disconnect": "Desconectar", "Dollars": "Dólares", diff --git a/src/i18n/pt.json b/src/i18n/pt.json index 6655dc273..54d495f14 100644 --- a/src/i18n/pt.json +++ b/src/i18n/pt.json @@ -76,6 +76,7 @@ "Available for {{count}} installments or less_other": "Disponível para {{count}} parcelas ou menos", "Available for repayment": "Disponível para pagamento", "Available funding": "Financiamento disponível", + "Available funding info": "Informações sobre financiamento disponível", "Available in 200+ countries and regions.": "Disponível em mais de 200 países e regiões.", "Available limit: {{asset}}": "Limite disponível: {{asset}}", "Available:": "Disponível:", @@ -179,6 +180,7 @@ "Destination network": "Rede de destino", "Destination": "Destino", "Details": "Detalhes", + "Dismiss": "Descartar", "Disconnect from {{name}}": "Desconectar de {{name}}", "Disconnect": "Desconectar", "Dollars": "Dólares",