From 552bcc196617766c3e05564727c0f389dd86211f Mon Sep 17 00:00:00 2001 From: j8seangel Date: Wed, 18 Sep 2024 18:24:13 +0200 Subject: [PATCH] polish insight styles --- .../VesselGroupReportInsight.module.css | 103 ---------------- .../VesselGroupReportInsightCoverage.tsx | 2 +- .../VesselGroupReportInsightFishing.tsx | 24 ++-- .../VesselGroupReportInsightFlagChange.tsx | 53 ++++---- .../insights/VesselGroupReportInsightGaps.tsx | 114 +++++++++--------- .../insights/VesselGroupReportInsightIUU.tsx | 35 +++--- .../insights/VesselGroupReportInsightMOU.tsx | 89 +++++++------- .../VesselGroupReportInsightVesselEvents.tsx | 2 +- .../VesselGroupReportInsights.module.css | 24 ++++ .../vessel-group-report.slice.ts | 2 +- .../src/collapsable/Collapsable.tsx | 2 +- 11 files changed, 196 insertions(+), 254 deletions(-) delete mode 100644 apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsight.module.css diff --git a/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsight.module.css b/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsight.module.css deleted file mode 100644 index 03fd61411e..0000000000 --- a/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsight.module.css +++ /dev/null @@ -1,103 +0,0 @@ -.placeholder { - padding-block: var(--space-XL); -} - -.disclaimer { - display: flex; - align-items: top; - margin: var(--space-L) var(--space-M); - font: var(--font-S); - color: var(--color-secondary-blue); -} - -.disclaimer svg { - margin-top: 0.2rem; -} - -.container { - padding-inline: var(--space-M); -} - -.title { - padding-top: var(--space-M); -} - -.insightContainer { - padding-block: var(--space-M); - border-bottom: var(--border); -} - -.insightContainer:last-child { - border-bottom: none; - padding-bottom: var(--space-L); -} - -.insightTitle { - display: flex; - align-items: center; -} - -.coverageBar { - margin-top: var(--space-M); - position: relative; - width: 20rem; - height: 0.5rem; - border-radius: 0.5rem; - background-image: linear-gradient(90deg, rgba(22, 63, 137, 0.2) 0%, rgba(22, 63, 137, 0.8) 100%); -} - -.coverageIndicator { - position: absolute; - width: 10rem; - transform: translate(-50%, -1.9rem); - display: flex; - flex-direction: column; - align-items: center; -} - -.coverageDot { - width: 1.2rem; - height: 1.2rem; - border-radius: 0.6rem; - background: var(--color-primary-blue); - border: 1px solid var(--color-white); -} - -.coverageLabel { - text-align: center; - line-height: 1; -} - -.secondary { - color: var(--color-secondary-blue); -} - -.eventDetailsList li { - padding-left: 0; - margin-left: var(--space-M); -} - -.eventDetailsList li:not(:last-child) { - border-bottom: var(--border); -} - -.seeMoreBtn { - top: 0.4rem; - margin-left: var(--space-XS); -} - -.insightContainer .collapsable { - justify-content: flex-start; -} - -.insightContainer .collapsable::before { - display: none; - content: ''; -} - -.insightContainer .collapsableLabel { - padding-left: 0; - font: var(--font-M); - color: var(--color-primary-blue); - text-transform: none; -} diff --git a/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsightCoverage.tsx b/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsightCoverage.tsx index 985df1657d..92dcc62d80 100644 --- a/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsightCoverage.tsx +++ b/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsightCoverage.tsx @@ -5,7 +5,7 @@ import { ParsedAPIError } from '@globalfishingwatch/api-client' import InsightError from 'features/vessel/insights/InsightErrorMessage' import DataTerminology from 'features/vessel/identity/DataTerminology' import { selectFetchVesselGroupReportCoverageParams } from '../vessel-group-report.selectors' -import styles from './VesselGroupReportInsight.module.css' +import styles from './VesselGroupReportInsights.module.css' import VesselGroupReportInsightCoverageGraph from './VesselGroupReportInsightCoverageGraph' const VesselGroupReportInsightCoveragePlaceholder = () => { diff --git a/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsightFishing.tsx b/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsightFishing.tsx index 28f7952c39..7a8543a399 100644 --- a/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsightFishing.tsx +++ b/apps/fishing-map/features/vessel-group-report/insights/VesselGroupReportInsightFishing.tsx @@ -1,14 +1,16 @@ import { useTranslation } from 'react-i18next' import { useGetVesselGroupInsightQuery } from 'queries/vessel-insight-api' -import { Fragment, useState } from 'react' +import { useState } from 'react' +import cx from 'classnames' import { useSelector } from 'react-redux' import { ParsedAPIError } from '@globalfishingwatch/api-client' import { Collapsable } from '@globalfishingwatch/ui-components' import InsightError from 'features/vessel/insights/InsightErrorMessage' import DataTerminology from 'features/vessel/identity/DataTerminology' +import { formatInfoField } from 'utils/info' import { selectVesselGroupReportData } from '../vessel-group-report.slice' import { selectFetchVesselGroupReportFishingParams } from '../vessel-group-report.selectors' -import styles from './VesselGroupReportInsight.module.css' +import styles from './VesselGroupReportInsights.module.css' import VesselGroupReportInsightPlaceholder from './VesselGroupReportInsightsPlaceholders' import VesselGroupReportInsightVesselEvents from './VesselGroupReportInsightVesselEvents' import { @@ -53,18 +55,18 @@ const VesselGroupReportInsightFishing = () => { const getVesselGroupReportInsighFishingVessels = (vessels: VesselGroupReportInsightVessel[]) => { return ( -