From 4c9b1927e83ccc7a4d0478423d9976e0e6f5bb46 Mon Sep 17 00:00:00 2001 From: Arnaud Fauconnet Date: Fri, 4 Nov 2022 11:01:26 +0100 Subject: [PATCH] Main page (transactions) is now responsive --- src/components/Transactions/Table.tsx | 4 +- src/scss/transactions.scss | 73 ++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 3 deletions(-) diff --git a/src/components/Transactions/Table.tsx b/src/components/Transactions/Table.tsx index 8f24583..ca5d891 100644 --- a/src/components/Transactions/Table.tsx +++ b/src/components/Transactions/Table.tsx @@ -49,9 +49,9 @@ export default () => { {row.date.toLocaleDateString()} - {row.description} + {row.description} {CHF_currency(row.amount)} - {CHF_currency(row.total)} + {CHF_currency(row.total)} ))} diff --git a/src/scss/transactions.scss b/src/scss/transactions.scss index 7df36aa..b8d720e 100644 --- a/src/scss/transactions.scss +++ b/src/scss/transactions.scss @@ -1,6 +1,7 @@ @use "style.scss"; @import "variables.module.scss"; + body.transactions { background-image: url("/public/backgroundCurvyLines.png"); @@ -67,6 +68,15 @@ body.transactions { // justify-content: center; align-items: center; + .description { + text-overflow: ellipsis; + white-space: nowrap; + // overflow: hidden; + } + .amount, .total{ + min-width: 6em; + } + .amount.positive { color: $fg-green; } @@ -79,13 +89,14 @@ body.transactions { aside { grid-column: 1; grid-row: 2; + min-width: 173px; form { display: flex; padding: 7px; justify-content: space-evenly; flex-direction: column; - padding-top:1em; + padding-top: 1em; .input { margin: .4em 0; @@ -95,4 +106,64 @@ body.transactions { } } } + + @media only screen and (max-width: 1044px) { + div#tablePage { + grid-template-columns: 1fr; + grid-template-rows: 1fr 1fr 10fr 1fr; + + header, + main, + aside, + footer { + grid-column: 1; + } + + header { + grid-row: 1; + position: sticky; + .box.left { + display: none; + } + } + + aside { + grid-row: 2; + + min-width: 0; + form { + flex-direction: row; + + h3 { + display: none; + } + + h2 { + text-align: center; + } + + .inputs-box { + // background: red; + width: 50vw; + display: flex; + flex-direction: row; + justify-content: space-evenly; + + .input { + // background: blue; + width: 10em; + } + } + } + } + + main { + grid-row: 3; + } + + footer { + grid-row: 4; + } + } + } } \ No newline at end of file