From 7c0c9329bc0aae1b431cb6562eae026bc9dd26f5 Mon Sep 17 00:00:00 2001 From: G Date: Wed, 29 May 2024 16:37:08 +0000 Subject: [PATCH] style it a little better with shadow and amount wrapped by color --- src/components/TransactionInformationsItem.tsx | 71 ++++++++++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/src/components/TransactionInformationsItem.tsx b/src/components/TransactionInformationsItem.tsx index 4fb68df..3decaa6 100644 --- a/src/components/TransactionInformationsItem.tsx +++ b/src/components/TransactionInformationsItem.tsx @@ -16,37 +16,33 @@ interface Props { moment.locale("fr"); const TransactionInformationsItem = ({ paymentType, reference, date, amount, status }: Props) => { - // date = new Date(date); const dateObject = Date.parse(date); return ( - - {/* */} - {}} /> + + + {}} /> + + + {reference} + {moment(dateObject).fromNow()} + - - {reference} - {moment(dateObject).fromNow()} - - - {/* - {amount} - */} + + @@ -56,22 +52,39 @@ const TransactionInformationsItem = ({ paymentType, reference, date, amount, sta const AmountColorRenderer = ({ status, amount }: { status: string; amount: number }) => { if (status === "SUCCESS") { return ( - - {amount} - + + + {amount} + + ); } if (status === "INITIATED") { return ( - - {amount} - + + + {amount} + + ); } return ( - - {amount} - + + + {amount} + + + ); +}; + +const AmountWrapper = ({ + color, + children, +}: { color: "secondary" | "softYellow" | "softRed"; children: React.ReactNode }) => { + return ( + + {children} + ); }; -- libgit2 0.27.1