From 1d481ba86d8cbf9a94674517de6211d7d3bb86f2 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Thu, 23 May 2024 08:36:34 +0200 Subject: [PATCH] fix: adjust earn and burn mobile view --- .../Points/EarnAndBurn/earnAndBurn.module.css | 27 +++++++++++- .../Blocks/Points/EarnAndBurn/index.tsx | 43 ++++++++++++++++--- 2 files changed, 62 insertions(+), 8 deletions(-) diff --git a/components/MyPages/Blocks/Points/EarnAndBurn/earnAndBurn.module.css b/components/MyPages/Blocks/Points/EarnAndBurn/earnAndBurn.module.css index 0716d088f..f8453d9e1 100644 --- a/components/MyPages/Blocks/Points/EarnAndBurn/earnAndBurn.module.css +++ b/components/MyPages/Blocks/Points/EarnAndBurn/earnAndBurn.module.css @@ -4,6 +4,7 @@ } .mobileTable { + border-collapse: collapse; border-spacing: 0; width: 100%; } @@ -13,7 +14,31 @@ } .mobileTh { + font-size: var(--typography-Body-Regular-fontSize); + font-weight: 500; padding: var(--Spacing-x2); + text-align: left; +} + +.mobileTr { + border-top: 1px solid var(--Main-Grey-10); +} + +.mobileTd { + padding: var(--Spacing-x2); +} + +.mobileTransactionDetails { + display: grid; + font-size: var(--typography-Footnote-Regular-fontSize); +} + +.mobileTransactionDate { + font-weight: 700; +} + +.mobileTransactionPoints { + font-size: var(--typography-Body-Regular-fontSize); } .mobilePlaceholder { @@ -27,8 +52,8 @@ } .table { - border-spacing: 0; border-collapse: collapse; + border-spacing: 0; width: 100%; } diff --git a/components/MyPages/Blocks/Points/EarnAndBurn/index.tsx b/components/MyPages/Blocks/Points/EarnAndBurn/index.tsx index 867277194..94b350491 100644 --- a/components/MyPages/Blocks/Points/EarnAndBurn/index.tsx +++ b/components/MyPages/Blocks/Points/EarnAndBurn/index.tsx @@ -39,10 +39,18 @@ function EarnAndBurn({ fetchNextPage() } } - + const transaction = { + city: "stockholm", + hotelName: "Hotel", + nights: 2, + awardPoints: 1000, + checkinDate: "2022-01-01", + checkoutDate: "2022-01-03", + confirmationNumber: "123456", + } const transactions = data?.pages.flatMap((page) => page.data) ?? [] return ( -
+
@@ -52,11 +60,32 @@ function EarnAndBurn({ {_("Points")} - {transactions.length ? ( - transactions.map((transaction) => ( - - {transaction.hotelName} - {transaction.awardPoints} + {transactions.length || true ? ( + [transaction, transaction, transaction].map((xtransaction) => ( + + + + {dt(transaction.checkinDate) + .locale(lang) + .format("DD MMM YYYY")} + + {transaction.hotelName && transaction.city ? ( + {`${transaction.hotelName}, ${transaction.city}`} + ) : null} + + {`${transaction.nights} ${_(transaction.nights === 1 ? "night" : "nights")}`} + + + + {`${transaction.awardPoints} P`} + )) ) : (