fix: adjust earn and burn mobile view
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mobileTable {
|
.mobileTable {
|
||||||
|
border-collapse: collapse;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -13,7 +14,31 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mobileTh {
|
.mobileTh {
|
||||||
|
font-size: var(--typography-Body-Regular-fontSize);
|
||||||
|
font-weight: 500;
|
||||||
padding: var(--Spacing-x2);
|
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 {
|
.mobilePlaceholder {
|
||||||
@@ -27,8 +52,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
border-spacing: 0;
|
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
border-spacing: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,18 @@ function EarnAndBurn({
|
|||||||
fetchNextPage()
|
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) ?? []
|
const transactions = data?.pages.flatMap((page) => page.data) ?? []
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className={styles.container}>
|
||||||
<Header title={title} link={link} subtitle={subtitle} />
|
<Header title={title} link={link} subtitle={subtitle} />
|
||||||
|
|
||||||
<div className={styles.mobileTableContainer}>
|
<div className={styles.mobileTableContainer}>
|
||||||
@@ -52,11 +60,32 @@ function EarnAndBurn({
|
|||||||
<th className={styles.mobileTh}>{_("Points")}</th>
|
<th className={styles.mobileTh}>{_("Points")}</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{transactions.length ? (
|
{transactions.length || true ? (
|
||||||
transactions.map((transaction) => (
|
[transaction, transaction, transaction].map((xtransaction) => (
|
||||||
<tr key={transaction.confirmationNumber}>
|
<tr
|
||||||
<td>{transaction.hotelName}</td>
|
className={styles.mobileTr}
|
||||||
<td>{transaction.awardPoints}</td>
|
key={transaction.confirmationNumber}
|
||||||
|
>
|
||||||
|
<td
|
||||||
|
className={`${styles.mobileTd} ${styles.mobileTransactionDetails}`}
|
||||||
|
>
|
||||||
|
<span className={styles.mobileTransactionDate}>
|
||||||
|
{dt(transaction.checkinDate)
|
||||||
|
.locale(lang)
|
||||||
|
.format("DD MMM YYYY")}
|
||||||
|
</span>
|
||||||
|
{transaction.hotelName && transaction.city ? (
|
||||||
|
<span>{`${transaction.hotelName}, ${transaction.city}`}</span>
|
||||||
|
) : null}
|
||||||
|
<span>
|
||||||
|
{`${transaction.nights} ${_(transaction.nights === 1 ? "night" : "nights")}`}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
className={`${styles.mobileTd} ${styles.mobileTransactionPoints}`}
|
||||||
|
>
|
||||||
|
{`${transaction.awardPoints} P`}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user