From 9d2a19dbf83545b7d1edc32ebe04ea44a8c9dd46 Mon Sep 17 00:00:00 2001 From: elpatron Date: Sat, 6 Jun 2026 21:07:51 +0200 Subject: [PATCH] feat: group freshwater, fuel, and greywater cards in collapsible Tanks section --- client/src/components/LogEntryEditor.tsx | 283 +++++++++++++---------- client/src/i18n/locales/da.json | 1 + client/src/i18n/locales/de.json | 1 + client/src/i18n/locales/en.json | 1 + client/src/i18n/locales/nb.json | 1 + client/src/i18n/locales/sv.json | 1 + 6 files changed, 161 insertions(+), 127 deletions(-) diff --git a/client/src/components/LogEntryEditor.tsx b/client/src/components/LogEntryEditor.tsx index 49b0d6e..ad1872b 100644 --- a/client/src/components/LogEntryEditor.tsx +++ b/client/src/components/LogEntryEditor.tsx @@ -298,6 +298,7 @@ export default function LogEntryEditor({ const [eventsCollapsed, setEventsCollapsed] = useState(true) const [addEventFormCollapsed, setAddEventFormCollapsed] = useState(false) + const [tanksCollapsed, setTanksCollapsed] = useState(true) const [loading, setLoading] = useState(false) const [saving, setSaving] = useState(false) @@ -1718,141 +1719,169 @@ export default function LogEntryEditor({ )} - {/* Section 2: Freshwater and Fuel Consumption */} -
- {/* Freshwater card */} -
-
+ {/* Section 2: Tanks (Freshwater, Fuel, and Greywater) */} +
+
setTanksCollapsed(!tanksCollapsed)} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault() + setTanksCollapsed(!tanksCollapsed) + } + }} + role="button" + aria-expanded={!tanksCollapsed} + tabIndex={0} + > +
-

{t('logs.freshwater')}

-
-
- - - -
- - -
+

{t('logs.tanks')}

+ {tanksCollapsed ? ( + + ) : ( + + )}
- {/* Fuel card */} -
-
- -

{t('logs.fuel')}

-
-
- - - -
- - + {!tanksCollapsed && ( +
+ {/* Freshwater card */} +
+
+ +

{t('logs.freshwater')}

+
+
+ + + +
+ + +
+
-
- - + {/* Fuel card */} +
+
+ +

{t('logs.fuel')}

+
+
+ + + +
+ + +
+ +
+ + +
+
+
+ + {/* Greywater card */} +
+
+ +

{t('logs.greywater')}

+
+
+ +
-
- - {/* Greywater card */} -
-
- -

{t('logs.greywater')}

-
-
- -
-
+ )}
{/* Section 3: Event Journal Entries */} diff --git a/client/src/i18n/locales/da.json b/client/src/i18n/locales/da.json index 33f63a6..bbbebfa 100644 --- a/client/src/i18n/locales/da.json +++ b/client/src/i18n/locales/da.json @@ -186,6 +186,7 @@ "departure": "Starthavn (rejse fra)", "destination": "Destinationsport (til)", "route": "Rejse fra/til", + "tanks": "Tanke", "freshwater": "Ferskvand (liter)", "fuel": "Treibstoff / Brændstof (liter)", "greywater": "Gråt vand (liter)", diff --git a/client/src/i18n/locales/de.json b/client/src/i18n/locales/de.json index c0bd62a..666fec4 100644 --- a/client/src/i18n/locales/de.json +++ b/client/src/i18n/locales/de.json @@ -186,6 +186,7 @@ "departure": "Start-Hafen (Reise von)", "destination": "Ziel-Hafen (nach)", "route": "Reise von/nach", + "tanks": "Tanks", "freshwater": "Frischwasser (Liter)", "fuel": "Treibstoff / Fuel (Liter)", "greywater": "Grauwasser (Liter)", diff --git a/client/src/i18n/locales/en.json b/client/src/i18n/locales/en.json index 0f6acad..0536bd5 100644 --- a/client/src/i18n/locales/en.json +++ b/client/src/i18n/locales/en.json @@ -186,6 +186,7 @@ "departure": "Departure Port (von)", "destination": "Destination Port (nach)", "route": "Route / Journey", + "tanks": "Tanks", "freshwater": "Freshwater (Liters)", "fuel": "Fuel (Liters)", "greywater": "Greywater (Liters)", diff --git a/client/src/i18n/locales/nb.json b/client/src/i18n/locales/nb.json index 7d72a44..5026fa0 100644 --- a/client/src/i18n/locales/nb.json +++ b/client/src/i18n/locales/nb.json @@ -186,6 +186,7 @@ "departure": "Starthavn (reise fra)", "destination": "Destinasjonsport (til)", "route": "Reise fra/til", + "tanks": "Tanker", "freshwater": "Ferskvann (liter)", "fuel": "Drivstoff / Drivstoff (liter)", "greywater": "Gråvann (liter)", diff --git a/client/src/i18n/locales/sv.json b/client/src/i18n/locales/sv.json index 3088929..127bbc7 100644 --- a/client/src/i18n/locales/sv.json +++ b/client/src/i18n/locales/sv.json @@ -186,6 +186,7 @@ "departure": "Starthamn (resa från)", "destination": "Destinationsport (till)", "route": "Resa från/till", + "tanks": "Tankar", "freshwater": "Färskvatten (liter)", "fuel": "Treibstoff / Bränsle (liter)", "greywater": "Gråvatten (liter)",