From 4862aef1883f7de4548f8db8bc988bd50bfd8263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98rjan=20Aare=20J=C3=B8rgensen?= Date: Tue, 24 Sep 2024 08:33:16 +0200 Subject: [PATCH] Add conditional rendering of metadata tables --- .../GrossDepositionEnviromentGroup.tsx | 82 ++++++------- .../OutcropAnalogueGroup.tsx | 84 ++++++------- .../StratigrapicGroups/StratigrapicGroups.tsx | 113 +++++++++--------- 3 files changed, 144 insertions(+), 135 deletions(-) diff --git a/src/components/GrossDepositionEnviroment/GrossDepositionEnviromentGroup/GrossDepositionEnviromentGroup.tsx b/src/components/GrossDepositionEnviroment/GrossDepositionEnviromentGroup/GrossDepositionEnviromentGroup.tsx index e2f665a..48447eb 100644 --- a/src/components/GrossDepositionEnviroment/GrossDepositionEnviromentGroup/GrossDepositionEnviromentGroup.tsx +++ b/src/components/GrossDepositionEnviroment/GrossDepositionEnviromentGroup/GrossDepositionEnviromentGroup.tsx @@ -109,47 +109,49 @@ export const GrossDepositionEnviromentGroup = ({ Gross Depositional Environment (GDE) - - - - - GDE - Depositional environment - Subenvironment - Architectural element - - - - - {gdeGroups.map((row) => ( - - - - - {row.grossDepEnv.identifier} - {row.depEnv.identifier} - {row.subenv.identifier} - - {row.architecturalElements.length > 0 && ( -
    - {row.architecturalElements.map((a) => ( -
  • {a.identifier}
  • - ))} -
- )} -
+ {gdeGroups.length > 0 && ( +
+ + + + GDE + Depositional environment + Subenvironment + Architectural element - ))} - -
+ + + + {gdeGroups.map((row) => ( + + + + + {row.grossDepEnv.identifier} + {row.depEnv.identifier} + {row.subenv.identifier} + + {row.architecturalElements.length > 0 && ( +
    + {row.architecturalElements.map((a) => ( +
  • {a.identifier}
  • + ))} +
+ )} +
+
+ ))} +
+ + )}
+ + + {row.name} + + {row.region} + + + {row.basins?.map((item) => item)} + + + + + {row.outcropCategory} + + + + ))} + + + )}