Skip to content

Commit

Permalink
fix: remove the extra accordion files and fix chronic nutrition svg
Browse files Browse the repository at this point in the history
  • Loading branch information
Armanpreet Ghotra committed Dec 19, 2024
1 parent be3ca0d commit 1f5b2ad
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 49 deletions.
8 changes: 4 additions & 4 deletions src/components/Map/FcsMap/FcsAccordion.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import FcsAccordionProps from '@/domain/props/FcsAccordionProps';
import { getFcsFoodSecurityAccordionItems } from '@/operations/map/FcsFoodSecurityOperations';
import { getMacroEconomicAccordionOperations } from '@/operations/map/FcsMacroEconomicOperations';
import { useMediaQuery } from '@/utils/resolution.ts';

import AccordionContainer from '../../Accordions/AccordionContainer';
import FcsFoodSecurityAccordion from './FcsFoodSecurityAccordion';
import FcsMacroEconomicAccordion from './FcsMacroEconomicAccordion';

export default function FcsAccordion({ countryData, loading, countryIso3Data, countryName }: FcsAccordionProps) {
const isMobile = useMediaQuery('(max-width: 700px)');
const foodSecurityAccordion = FcsFoodSecurityAccordion({ countryData, countryIso3Data });
const macroEconomicAccordion = FcsMacroEconomicAccordion({ countryData, countryIso3Data });
const foodSecurityAccordion = getFcsFoodSecurityAccordionItems(countryData, countryIso3Data);
const macroEconomicAccordion = getMacroEconomicAccordionOperations(countryData, countryIso3Data);

return (
<>
Expand Down
7 changes: 0 additions & 7 deletions src/components/Map/FcsMap/FcsFoodSecurityAccordion.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions src/components/Map/FcsMap/FcsMacroEconomicAccordion.tsx

This file was deleted.

12 changes: 5 additions & 7 deletions src/components/Map/IpcMap/IpcAccordion.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import AccordionContainer from '@/components/Accordions/AccordionContainer';
import IpcAccordionProps from '@/domain/props/IpcAccordionProps';
import { IpcFoodSecurityAccordionOperations } from '@/operations/map/IpcFoodSecurityOperations';
import { useMediaQuery } from '@/utils/resolution.ts';

import IpcFoodSecurityAccordion from './IpcFoodSecurityAccordion';
import IpcNutritionAccordion from './IpcNutritionAccordion';

export default function IpcAccordion({ countryData, countryName, countryIso3Data }: IpcAccordionProps) {
const deltaOneMonth = countryData?.fcsMinus1 ? countryData.fcs - countryData.fcsMinus1 : null;
const deltaThreeMonth = countryData?.fcsMinus3 ? countryData.fcs - countryData.fcsMinus3 : null;

const ipcFoodSecurityAccordion = IpcFoodSecurityAccordion({
const ipcFoodSecurityAccordion = IpcFoodSecurityAccordionOperations.getFoodSecurityAccordionItems(
countryData,
deltaOneMonth,
deltaThreeMonth,
});
const ipcNutrititonAccordion = IpcNutritionAccordion({ countryIso3Data });
deltaThreeMonth
);
const ipcNutrititonAccordion = IpcFoodSecurityAccordionOperations.getNutritionAccordion(countryIso3Data);
const isMobile = useMediaQuery('(max-width: 700px)');

return (
Expand Down
15 changes: 0 additions & 15 deletions src/components/Map/IpcMap/IpcFoodSecurityAccordion.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions src/components/Map/IpcMap/IpcNutritionAccordion.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/operations/map/FcsFoodSecurityOperations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function getFcsFoodSecurityAccordionItems(
title="Chronic Nutrition"
content={[
{
svgIcon: <Nutrition className="w-[30px] h-[30px] object-contain" />,
svgIcon: <Nutrition className="w-[40px] h-[40px] object-contain" />,
text: (
<NutritionAccordionText
nutritionValue={`${nutritionData.Chronic} %`}
Expand Down
2 changes: 1 addition & 1 deletion src/operations/map/IpcFoodSecurityOperations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const IpcFoodSecurityAccordionOperations = {
title="Chronic Nutrition"
content={[
{
svgIcon: <Nutrition className="w-[50px] h-[50px] object-contain" />,
svgIcon: <Nutrition className="w-[40px] h-[40px] object-contain" />,
text: (
<NutritionAccordionText
nutritionValue={`${nutritionData.Chronic} %`}
Expand Down

0 comments on commit 1f5b2ad

Please sign in to comment.