From 03e15d76c8addeee9a977fb71fe3ad9da0a39e28 Mon Sep 17 00:00:00 2001 From: guillermo dieguez Date: Wed, 27 Nov 2024 10:46:05 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20app:=20implement=20empty=20state=20?= =?UTF-8?q?for=20payments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/warm-pants-type.md | 5 ++ src/components/payments/Empty.tsx | 33 +++++++++++++ src/components/payments/Payments.tsx | 73 +++++++++++++++------------- 3 files changed, 78 insertions(+), 33 deletions(-) create mode 100644 .changeset/warm-pants-type.md create mode 100644 src/components/payments/Empty.tsx diff --git a/.changeset/warm-pants-type.md b/.changeset/warm-pants-type.md new file mode 100644 index 00000000..0c504a88 --- /dev/null +++ b/.changeset/warm-pants-type.md @@ -0,0 +1,5 @@ +--- +"@exactly/mobile": patch +--- + +✨ implement empty state for payments screen diff --git a/src/components/payments/Empty.tsx b/src/components/payments/Empty.tsx new file mode 100644 index 00000000..03c5604c --- /dev/null +++ b/src/components/payments/Empty.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { StyleSheet } from "react-native"; +import { YStack } from "tamagui"; + +import Blob from "../../assets/images/exa-card-blob.svg"; +import ExaCard from "../../assets/images/exa-card.svg"; +import Text from "../shared/Text"; +import View from "../shared/View"; + +export default function Empty() { + return ( + + + + + + + + + + + + + No payments pending + + + You're all caught up! Start using your card to see payments listed here. + + + + + ); +} diff --git a/src/components/payments/Payments.tsx b/src/components/payments/Payments.tsx index ae230de4..a13ce984 100644 --- a/src/components/payments/Payments.tsx +++ b/src/components/payments/Payments.tsx @@ -4,6 +4,7 @@ import { ms } from "react-native-size-matters"; import { ScrollView } from "tamagui"; import { zeroAddress } from "viem"; +import Empty from "./Empty"; import NextPayment from "./NextPayment"; import UpcomingPayments from "./UpcomingPayments"; import { useReadPreviewerExactly } from "../../generated/contracts"; @@ -32,7 +33,7 @@ export default function Payments() { } > - - - - Payments - - - - - - - {(Number(usdDue) / 1e18).toLocaleString(undefined, { - style: "currency", - currency: "USD", - currencyDisplay: "narrowSymbol", - })} + {usdDue === 0n ? ( + + ) : ( + <> + + + + Payments - - - Total debt - + + + + + {(Number(usdDue) / 1e18).toLocaleString(undefined, { + style: "currency", + currency: "USD", + currencyDisplay: "narrowSymbol", + })} + + + + + Total debt + + + - - - - - - + + + + + + )}