Skip to content

Commit

Permalink
Merge pull request #239 from Vizzuality/SKY30-355-fe-temporarily-hide…
Browse files Browse the repository at this point in the history
…-the

[SKY30-355] hides temporary protected seas data
  • Loading branch information
andresgnlez authored Apr 10, 2024
2 parents 9411f53 + 9bb15bc commit 7543953
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,22 @@ const useColumns = () => {
return <span className="text-xs">{formattedValue}%</span>;
},
},
{
accessorKey: 'highlyProtectedLfp',
header: ({ column }) => (
<HeaderItem>
<SortingButton column={column} />
Highly Protected LFP
<TooltipButton column={column} tooltips={tooltips} />
</HeaderItem>
),
cell: ({ row }) => {
const { highlyProtectedLfp: value } = row.original;
if (!value) return <>No data</>;
const formattedValue = cellFormatter.percentage(value);
return <span className="text-xs">{formattedValue}%</span>;
},
},
// {
// accessorKey: 'highlyProtectedLfp',
// header: ({ column }) => (
// <HeaderItem>
// <SortingButton column={column} />
// Highly Protected LFP
// <TooltipButton column={column} tooltips={tooltips} />
// </HeaderItem>
// ),
// cell: ({ row }) => {
// const { highlyProtectedLfp: value } = row.original;
// if (!value) return <>No data</>;
// const formattedValue = cellFormatter.percentage(value);
// return <span className="text-xs">{formattedValue}%</span>;
// },
// },
{
accessorKey: 'globalContribution',
header: ({ column }) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const useColumns = ({ filters, onFiltersChange }: UseColumnsProps) => {
protectionStatus: protectionStatusOptions,
establishmentStage: establishmentStageOptions,
protectionLevel: protectionLevelOptions,
fishingProtectionLevel: fishingProtectionLevelOptions,
// fishingProtectionLevel: fishingProtectionLevelOptions,
} = useFiltersOptions();

const tooltips = useTooltips();
Expand Down Expand Up @@ -159,27 +159,27 @@ const useColumns = ({ filters, onFiltersChange }: UseColumnsProps) => {
return <>{formattedValue}</>;
},
},
{
accessorKey: 'fishingProtectionLevel',
header: ({ column }) => (
<HeaderItem>
<FiltersButton
field={column.id}
options={fishingProtectionLevelOptions}
values={filters[column.id]}
onChange={onFiltersChange}
/>
Level of Fishing Protection
<TooltipButton column={column} tooltips={tooltips} />
</HeaderItem>
),
cell: ({ row }) => {
const { fishingProtectionLevel: value } = row.original;
const formattedValue =
fishingProtectionLevelOptions.find((entry) => value === entry?.value)?.name || 'N/A';
return <>{formattedValue}</>;
},
},
// {
// accessorKey: 'fishingProtectionLevel',
// header: ({ column }) => (
// <HeaderItem>
// <FiltersButton
// field={column.id}
// options={fishingProtectionLevelOptions}
// values={filters[column.id]}
// onChange={onFiltersChange}
// />
// Level of Fishing Protection
// <TooltipButton column={column} tooltips={tooltips} />
// </HeaderItem>
// ),
// cell: ({ row }) => {
// const { fishingProtectionLevel: value } = row.original;
// const formattedValue =
// fishingProtectionLevelOptions.find((entry) => value === entry?.value)?.name || 'N/A';
// return <>{formattedValue}</>;
// },
// },
];
}, [
filters,
Expand All @@ -188,7 +188,7 @@ const useColumns = ({ filters, onFiltersChange }: UseColumnsProps) => {
protectionStatusOptions,
establishmentStageOptions,
protectionLevelOptions,
fishingProtectionLevelOptions,
// fishingProtectionLevelOptions,
]);

return columns;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { cn } from '@/lib/classnames';
import { useGetLocations } from '@/types/generated/location';

// import EstablishmentStagesWidget from './establishment-stages';
import FishingProtectionWidget from './fishing-protection';
// import FishingProtectionWidget from './fishing-protection';
import HabitatWidget from './habitat';
import MarineConservationWidget from './marine-conservation';
import ProtectionTypesWidget from './protection-types';
Expand All @@ -32,7 +32,7 @@ const DetailsWidgets: React.FC = () => {
>
<MarineConservationWidget location={locationsData?.data[0]?.attributes} />
<ProtectionTypesWidget location={locationsData?.data[0]?.attributes} />
<FishingProtectionWidget location={locationsData?.data[0]?.attributes} />
{/* <FishingProtectionWidget location={locationsData?.data[0]?.attributes} /> */}
{/* <EstablishmentStagesWidget location={locationsData?.data[0]?.attributes} /> */}
<HabitatWidget location={locationsData?.data[0]?.attributes} />
</div>
Expand Down

0 comments on commit 7543953

Please sign in to comment.