From b8d24732862f80197afaeac7c378117b9aa728b2 Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Tue, 3 Dec 2024 12:01:06 +0100 Subject: [PATCH] Modifiche stilistiche varie. --- app/components/Balance.tsx | 2 +- app/components/Credit.tsx | 2 +- app/components/Headers.tsx | 100 +++++++++++++++++--------------- app/components/Loading.tsx | 2 +- app/components/Transactions.tsx | 28 ++++----- app/globals.css | 6 ++ app/page.tsx | 2 +- arduino/esp-caffe/esp-caffe.ino | 2 +- 8 files changed, 78 insertions(+), 66 deletions(-) diff --git a/app/components/Balance.tsx b/app/components/Balance.tsx index adfcc46..d91bdcc 100644 --- a/app/components/Balance.tsx +++ b/app/components/Balance.tsx @@ -19,7 +19,7 @@ export default function Balance() { if (loading) return if (error) return return
-

Bilancio complessivo: , caffé: {data.balance.count}

+

Bilancio: ({data.balance.count} caffè)

} diff --git a/app/components/Credit.tsx b/app/components/Credit.tsx index d44af87..0248d43 100644 --- a/app/components/Credit.tsx +++ b/app/components/Credit.tsx @@ -17,7 +17,7 @@ export default function Credit() { if (loading) return if (error) return return
-

Il tuo credito: , caffé: {data.credit.count}

+

Credito: ({data.credit.count} caffè)

} diff --git a/app/components/Headers.tsx b/app/components/Headers.tsx index a038da6..1d90879 100644 --- a/app/components/Headers.tsx +++ b/app/components/Headers.tsx @@ -18,7 +18,7 @@ export default function Headers() { const isAdmin = profile?.admin; const navigation: { name: string, href: string, current: boolean }[] = [ - { name: 'caffé', href: '/', current: current_path === '/' }, + { name: 'caffè', href: '/', current: current_path === '/' }, ] if (profile && !profile.code) { @@ -32,60 +32,35 @@ export default function Headers() { // see: https://tailwindui.com/components/application-ui/navigation/navbars - return -
-
- dm-coffee - - {package_json.version} - -
-
-
{/* perché non viene allineato a destra?!? */} - { - session?.user?.email && - {session?.user?.email} - } -
-
-
-
-
+ return +
+
+
{/* Mobile menu button*/} - + Open main menu +
-
-
- - ☕ +
+ + ☕ + +
+ dm-coffee

+ + v{package_json.version} -
-
-
- {navigation.map((item) => ( - - {item.name} - - ))}
+
-
-
+
+
{/* Profile dropdown */} - +
@@ -94,16 +69,28 @@ export default function Headers() { ? : } + { + session?.user?.name && +
+

{session?.user?.name}

+

{session?.user?.email}

+
+ }
+ { + session?.user?.email && +

{session?.user?.email}

+ } +
-
+ +
diff --git a/app/components/Loading.tsx b/app/components/Loading.tsx index c936f1a..9f6e60d 100644 --- a/app/components/Loading.tsx +++ b/app/components/Loading.tsx @@ -1,5 +1,5 @@ export default function Loading() { - return "..." + return ... } \ No newline at end of file diff --git a/app/components/Transactions.tsx b/app/components/Transactions.tsx index 53c971b..8f1eff3 100644 --- a/app/components/Transactions.tsx +++ b/app/components/Transactions.tsx @@ -22,27 +22,27 @@ export default function Transactions() { if (loading) return if (error) return - return - + return <>
+ - - - - - + + + + + {data.myTransactions.map((transaction: any, i: number) => - - - - - - - + + + + + + )}
quando#descrizionetesseraquando#descrizionetessera
{myDate(transaction.timestamp)}{myTime(transaction.timestamp)}{transaction.count || ""}{transaction.description}{transaction.code||''}
{myDate(transaction.timestamp)} {myTime(transaction.timestamp)}{transaction.count || ""}{transaction.description}{transaction.code||''}
+ } diff --git a/app/globals.css b/app/globals.css index 6ed65f2..66f6720 100644 --- a/app/globals.css +++ b/app/globals.css @@ -44,4 +44,10 @@ table td { a { color: blue; text-decoration: none; +} + +body { + margin: 0; + margin-left: auto; + margin-right: auto; } \ No newline at end of file diff --git a/app/page.tsx b/app/page.tsx index cc6d600..01bc4d1 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -16,8 +16,8 @@ export default function Home() { function Dashboard() { return
- +
} diff --git a/arduino/esp-caffe/esp-caffe.ino b/arduino/esp-caffe/esp-caffe.ino index cda254c..ab7d88b 100644 --- a/arduino/esp-caffe/esp-caffe.ino +++ b/arduino/esp-caffe/esp-caffe.ino @@ -15,7 +15,7 @@ extern "C" { } #define SS_PIN D8 -#define RST_PIN D3 +#define RST_PIN 0 #define API_URL "https://coffee.dm.unipi.it/graphql" #define LCD_TIMEOUT 5000