diff --git a/package.json b/package.json index 7fd1c60e..f75b47d3 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "@nextui-org/card": "^2.0.34", "@nextui-org/chip": "^2.0.33", "@nextui-org/code": "2.0.33", - "pdfjs-dist": "3.11.174", "@nextui-org/dropdown": "^2.1.31", "@nextui-org/image": "^2.0.32", "@nextui-org/input": "2.2.5", @@ -62,7 +61,7 @@ "leaflet-defaulticon-compatibility": "^0.1.2", "leaflet-geosearch": "^4.0.0", "lucide-react": "^0.454.0", - "next": "14.2.10", + "next": "14.2.15", "next-sitemap": "^4.2.3", "next-themes": "^0.2.1", "nextui-cli": "^0.3.4", diff --git a/public/Images/Comparison-preview.png b/public/Images/Comparison-preview.png new file mode 100644 index 00000000..cdda7ab2 Binary files /dev/null and b/public/Images/Comparison-preview.png differ diff --git a/src/app/comparison-portal/layout.tsx b/src/app/comparison-portal/layout.tsx index 7443535c..a1c2903d 100644 --- a/src/app/comparison-portal/layout.tsx +++ b/src/app/comparison-portal/layout.tsx @@ -2,9 +2,51 @@ import { Metadata } from 'next'; import HungerMapChatbot from '@/components/Chatbot/Chatbot'; import { Topbar } from '@/components/Topbar/Topbar'; +import { siteConfig } from '@/config/site'; export const metadata: Metadata = { - title: 'Comparison Portal', + title: { + default: 'Comparison Portal', + template: `%s - ${siteConfig.name}`, + }, + description: + 'Compare real-time global hunger data across different countries and regions. Obtain food insecurity statistics from the WFP Hunger Map Comparison Portal, tailored to various time zones. A valuable resource for humanitarian efforts and research.', + keywords: siteConfig.keywords, + openGraph: { + title: `Comparison Portal - ${siteConfig.name}`, + description: + 'Compare real-time global hunger data across different countries and regions. Obtain food insecurity statistics from the WFP Hunger Map Comparison Portal, tailored to various time zones. Essential for humanitarian aid and research.', + url: `${siteConfig.domain}/comparison-portal`, + images: [ + { + url: '/Images/Comparison-preview.png', + width: 1200, + height: 630, + alt: `Comparison Portal - ${siteConfig.name}`, + }, + ], + type: 'website', + }, + twitter: { + card: 'summary_large_image', + title: `Comparison Portal - ${siteConfig.name}`, + description: + 'Access comparable global hunger data from the WFP Hunger Map Comparison Portal, tailored to different countries and time zones.', + images: [ + { + url: '/Images/Comparison-preview.png', + width: 1200, + height: 630, + alt: `Comparison Portal - ${siteConfig.name}`, + }, + ], + site: '@WFP', + }, + robots: { + index: true, + follow: true, + nocache: false, + }, }; export default function Layout({ children }: { children: React.ReactNode }) { diff --git a/src/components/Accordions/AccordionModalSkeleton.tsx b/src/components/Accordions/AccordionModalSkeleton.tsx new file mode 100644 index 00000000..75bdae98 --- /dev/null +++ b/src/components/Accordions/AccordionModalSkeleton.tsx @@ -0,0 +1,17 @@ +import { Skeleton } from '@nextui-org/skeleton'; + +export default function AccordionModalSkeleton() { + return ( +
+ {/* For screens smaller than 450px */} +
+ +
+ + {/* For screens between 450px and 700px */} +
+ +
+
+ ); +} diff --git a/src/components/Map/FcsMap/FcsChoropleth.tsx b/src/components/Map/FcsMap/FcsChoropleth.tsx index bdf9eeb7..3f36570f 100644 --- a/src/components/Map/FcsMap/FcsChoropleth.tsx +++ b/src/components/Map/FcsMap/FcsChoropleth.tsx @@ -11,6 +11,7 @@ import FcsChoroplethProps from '@/domain/props/FcsChoroplethProps'; import FcsChoroplethOperations from '@/operations/map/FcsChoroplethOperations'; import { MapOperations } from '@/operations/map/MapOperations'; +import AccordionModalSkeleton from '../../Accordions/AccordionModalSkeleton'; import CountryLoadingLayer from '../CountryLoading'; import FscCountryChoropleth from './FcsCountryChoropleth'; @@ -65,11 +66,14 @@ export default function FcsChoropleth({ )} {/* Animated GeoJSON layer for the selected country */} {selectedCountryId && (!regionData || !regionLabelData) && ( - + <> + + + )} {regionData && countryId === selectedCountryId && regionLabelData && ( )} {!ipcRegionData && selectedCountryId && ( - feature?.properties?.adm0_id === selectedCountryId), - } as FeatureCollection - } - selectedCountryId={selectedCountryId} - color="hsl(var(--nextui-ipcAnimation))" - /> + <> + feature?.properties?.adm0_id === selectedCountryId), + } as FeatureCollection + } + selectedCountryId={selectedCountryId} + color="hsl(var(--nextui-ipcAnimation))" + /> + + )} {ipcRegionData && ( diff --git a/src/components/Map/Map.tsx b/src/components/Map/Map.tsx index ae968d7d..cc375287 100644 --- a/src/components/Map/Map.tsx +++ b/src/components/Map/Map.tsx @@ -94,6 +94,7 @@ export default function Map({ countries, disputedAreas, fcsData, alertData }: Ma window.gtag('event', `${selectedCountryData.properties.iso3}_country_selected`, { selectedMap: selectedMapType, }); + window.gtag('event', `${selectedCountryData.properties.iso3} _${selectedMapType}_countrymap_selected`); setSelectedCountryName(selectedCountryData.properties.adm0_name); mapRef.current?.fitBounds(L.geoJSON(selectedCountryData as GeoJSON).getBounds(), { animate: true }); } diff --git a/src/components/Map/NutritionMap/NutritionChoropleth.tsx b/src/components/Map/NutritionMap/NutritionChoropleth.tsx index 310ce0d0..977d6c39 100644 --- a/src/components/Map/NutritionMap/NutritionChoropleth.tsx +++ b/src/components/Map/NutritionMap/NutritionChoropleth.tsx @@ -12,6 +12,7 @@ import NutritionChoroplethProps from '@/domain/props/NutritionChoroplethProps'; import { MapOperations } from '@/operations/map/MapOperations'; import NutritionChoroplethOperations from '@/operations/map/NutritionChoroplethOperations'; +import AccordionModalSkeleton from '../../Accordions/AccordionModalSkeleton'; import CountryLoadingLayer from '../CountryLoading'; import NutritionStateChoropleth from './NutritionStateChoropleth'; @@ -69,11 +70,14 @@ export default function NutritionChoropleth({ )} {/* Animated GeoJSON layer for the selected country */} {selectedCountryId && (!regionNutritionData || !regionLabelData) && ( - + <> + + + )} { // if this country ('countryId') is selected and data is loaded ('regionNutritionData') show Choropleth for all states diff --git a/tailwind.config.js b/tailwind.config.js index b4288115..8d50e4d2 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -64,6 +64,7 @@ const config = { }, screens: { sm700: '700px', + sm450: '450px', }, width: { '215px': '215px', diff --git a/yarn.lock b/yarn.lock index 2a52bdda..233f196a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1380,10 +1380,15 @@ semver "^7.3.5" tar "^6.1.11" -"@next/env@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.10.tgz#1d3178340028ced2d679f84140877db4f420333c" - integrity sha512-dZIu93Bf5LUtluBXIv4woQw2cZVZ2DJTjax5/5DOs3lzEOeKLy7GxRSr4caK9/SCPdaW6bCgpye6+n4Dh9oJPw== +"@next/env@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.15.tgz#06d984e37e670d93ddd6790af1844aeb935f332f" + integrity sha512-S1qaj25Wru2dUpcIZMjxeMVSwkt8BK4dmWHHiBuRstcIyOsMapqT4A4jSB6onvqeygkSSmOkyny9VVx8JIGamQ== + +"@next/env@^13.4.3": + version "13.5.7" + resolved "https://registry.yarnpkg.com/@next/env/-/env-13.5.7.tgz#5006f4460a7fa598a03e1c2aa4e59e45c71082d3" + integrity sha512-uVuRqoj28Ys/AI/5gVEgRAISd0KWI0HRjOO1CTpNgmX3ZsHb5mdn14Y59yk0IxizXdo7ZjsI2S7qbWnO+GNBcA== "@next/env@^13.4.3": version "13.5.7" @@ -1397,50 +1402,50 @@ dependencies: fast-glob "3.3.1" -"@next/swc-darwin-arm64@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.10.tgz#49d10ca4086fbd59ee68e204f75d7136eda2aa80" - integrity sha512-V3z10NV+cvMAfxQUMhKgfQnPbjw+Ew3cnr64b0lr8MDiBJs3eLnM6RpGC46nhfMZsiXgQngCJKWGTC/yDcgrDQ== - -"@next/swc-darwin-x64@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.10.tgz#0ebeae3afb8eac433882b79543295ab83624a1a8" - integrity sha512-Y0TC+FXbFUQ2MQgimJ/7Ina2mXIKhE7F+GUe1SgnzRmwFY3hX2z8nyVCxE82I2RicspdkZnSWMn4oTjIKz4uzA== - -"@next/swc-linux-arm64-gnu@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.10.tgz#7e602916d2fb55a3c532f74bed926a0137c16f20" - integrity sha512-ZfQ7yOy5zyskSj9rFpa0Yd7gkrBnJTkYVSya95hX3zeBG9E55Z6OTNPn1j2BTFWvOVVj65C3T+qsjOyVI9DQpA== - -"@next/swc-linux-arm64-musl@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.10.tgz#6b143f628ccee490b527562e934f8de578d4be47" - integrity sha512-n2i5o3y2jpBfXFRxDREr342BGIQCJbdAUi/K4q6Env3aSx8erM9VuKXHw5KNROK9ejFSPf0LhoSkU/ZiNdacpQ== - -"@next/swc-linux-x64-gnu@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.10.tgz#086f2f16a0678890a1eb46518c4dda381b046082" - integrity sha512-GXvajAWh2woTT0GKEDlkVhFNxhJS/XdDmrVHrPOA83pLzlGPQnixqxD8u3bBB9oATBKB//5e4vpACnx5Vaxdqg== - -"@next/swc-linux-x64-musl@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.10.tgz#1befef10ed8dbcc5047b5d637a25ae3c30a0bfc3" - integrity sha512-opFFN5B0SnO+HTz4Wq4HaylXGFV+iHrVxd3YvREUX9K+xfc4ePbRrxqOuPOFjtSuiVouwe6uLeDtabjEIbkmDA== - -"@next/swc-win32-arm64-msvc@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.10.tgz#731f52c3ae3c56a26cf21d474b11ae1529531209" - integrity sha512-9NUzZuR8WiXTvv+EiU/MXdcQ1XUvFixbLIMNQiVHuzs7ZIFrJDLJDaOF1KaqttoTujpcxljM/RNAOmw1GhPPQQ== - -"@next/swc-win32-ia32-msvc@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.10.tgz#32723ef7f04e25be12af357cc72ddfdd42fd1041" - integrity sha512-fr3aEbSd1GeW3YUMBkWAu4hcdjZ6g4NBl1uku4gAn661tcxd1bHs1THWYzdsbTRLcCKLjrDZlNp6j2HTfrw+Bg== - -"@next/swc-win32-x64-msvc@14.2.10": - version "14.2.10" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.10.tgz#ee1d036cb5ec871816f96baee7991035bb242455" - integrity sha512-UjeVoRGKNL2zfbcQ6fscmgjBAS/inHBh63mjIlfPg/NG8Yn2ztqylXt5qilYb6hoHIwaU2ogHknHWWmahJjgZQ== +"@next/swc-darwin-arm64@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.15.tgz#6386d585f39a1c490c60b72b1f76612ba4434347" + integrity sha512-Rvh7KU9hOUBnZ9TJ28n2Oa7dD9cvDBKua9IKx7cfQQ0GoYUwg9ig31O2oMwH3wm+pE3IkAQ67ZobPfEgurPZIA== + +"@next/swc-darwin-x64@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.15.tgz#b7baeedc6a28f7545ad2bc55adbab25f7b45cb89" + integrity sha512-5TGyjFcf8ampZP3e+FyCax5zFVHi+Oe7sZyaKOngsqyaNEpOgkKB3sqmymkZfowy3ufGA/tUgDPPxpQx931lHg== + +"@next/swc-linux-arm64-gnu@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.15.tgz#fa13c59d3222f70fb4cb3544ac750db2c6e34d02" + integrity sha512-3Bwv4oc08ONiQ3FiOLKT72Q+ndEMyLNsc/D3qnLMbtUYTQAmkx9E/JRu0DBpHxNddBmNT5hxz1mYBphJ3mfrrw== + +"@next/swc-linux-arm64-musl@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.15.tgz#30e45b71831d9a6d6d18d7ac7d611a8d646a17f9" + integrity sha512-k5xf/tg1FBv/M4CMd8S+JL3uV9BnnRmoe7F+GWC3DxkTCD9aewFRH1s5rJ1zkzDa+Do4zyN8qD0N8c84Hu96FQ== + +"@next/swc-linux-x64-gnu@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.15.tgz#5065db17fc86f935ad117483f21f812dc1b39254" + integrity sha512-kE6q38hbrRbKEkkVn62reLXhThLRh6/TvgSP56GkFNhU22TbIrQDEMrO7j0IcQHcew2wfykq8lZyHFabz0oBrA== + +"@next/swc-linux-x64-musl@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.15.tgz#3c4a4568d8be7373a820f7576cf33388b5dab47e" + integrity sha512-PZ5YE9ouy/IdO7QVJeIcyLn/Rc4ml9M2G4y3kCM9MNf1YKvFY4heg3pVa/jQbMro+tP6yc4G2o9LjAz1zxD7tQ== + +"@next/swc-win32-arm64-msvc@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.15.tgz#fb812cc4ca0042868e32a6a021da91943bb08b98" + integrity sha512-2raR16703kBvYEQD9HNLyb0/394yfqzmIeyp2nDzcPV4yPjqNUG3ohX6jX00WryXz6s1FXpVhsCo3i+g4RUX+g== + +"@next/swc-win32-ia32-msvc@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.15.tgz#ec26e6169354f8ced240c1427be7fd485c5df898" + integrity sha512-fyTE8cklgkyR1p03kJa5zXEaZ9El+kDNM5A+66+8evQS5e/6v0Gk28LqA0Jet8gKSOyP+OTm/tJHzMlGdQerdQ== + +"@next/swc-win32-x64-msvc@14.2.15": + version "14.2.15" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.15.tgz#18d68697002b282006771f8d92d79ade9efd35c4" + integrity sha512-SzqGbsLsP9OwKNUG9nekShTwhj6JSB9ZLMWQ8g1gG6hdE5gQLncbnbymrwy2yVmH9nikSLYRYxYMFu78Ggp7/g== "@nextui-org/accordion@2.0.40", "@nextui-org/accordion@^2.0.40": version "2.0.40" @@ -8849,12 +8854,12 @@ next-themes@^0.2.1: resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.2.1.tgz#0c9f128e847979daf6c67f70b38e6b6567856e45" integrity sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A== -next@14.2.10: - version "14.2.10" - resolved "https://registry.yarnpkg.com/next/-/next-14.2.10.tgz#331981a4fecb1ae8af1817d4db98fc9687ee1cb6" - integrity sha512-sDDExXnh33cY3RkS9JuFEKaS4HmlWmDKP1VJioucCG6z5KuA008DPsDZOzi8UfqEk3Ii+2NCQSJrfbEWtZZfww== +next@14.2.15: + version "14.2.15" + resolved "https://registry.yarnpkg.com/next/-/next-14.2.15.tgz#348e5603e22649775d19c785c09a89c9acb5189a" + integrity sha512-h9ctmOokpoDphRvMGnwOJAedT6zKhwqyZML9mDtspgf4Rh3Pn7UTYKqePNoDvhsWBAO5GoPNYshnAUGIazVGmw== dependencies: - "@next/env" "14.2.10" + "@next/env" "14.2.15" "@swc/helpers" "0.5.5" busboy "1.6.0" caniuse-lite "^1.0.30001579" @@ -8862,15 +8867,15 @@ next@14.2.10: postcss "8.4.31" styled-jsx "5.1.1" optionalDependencies: - "@next/swc-darwin-arm64" "14.2.10" - "@next/swc-darwin-x64" "14.2.10" - "@next/swc-linux-arm64-gnu" "14.2.10" - "@next/swc-linux-arm64-musl" "14.2.10" - "@next/swc-linux-x64-gnu" "14.2.10" - "@next/swc-linux-x64-musl" "14.2.10" - "@next/swc-win32-arm64-msvc" "14.2.10" - "@next/swc-win32-ia32-msvc" "14.2.10" - "@next/swc-win32-x64-msvc" "14.2.10" + "@next/swc-darwin-arm64" "14.2.15" + "@next/swc-darwin-x64" "14.2.15" + "@next/swc-linux-arm64-gnu" "14.2.15" + "@next/swc-linux-arm64-musl" "14.2.15" + "@next/swc-linux-x64-gnu" "14.2.15" + "@next/swc-linux-x64-musl" "14.2.15" + "@next/swc-win32-arm64-msvc" "14.2.15" + "@next/swc-win32-ia32-msvc" "14.2.15" + "@next/swc-win32-x64-msvc" "14.2.15" nextui-cli@^0.3.4: version "0.3.5" @@ -9153,18 +9158,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -path2d-polyfill@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/path2d-polyfill/-/path2d-polyfill-2.1.1.tgz#6098b7bf2fc24c306c6377bcd558b17ba437ea27" - integrity sha512-4Rka5lN+rY/p0CdD8+E+BFv51lFaFvJOrlOhyQ+zjzyQrzyh3ozmxd1vVGGDdIbUFSBtIZLSnspxTgPT0iJhvA== - dependencies: - path2d "0.1.1" - -path2d@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/path2d/-/path2d-0.1.1.tgz#d3c3886cd2252fb2a7830c27ea7bb9a862d937ea" - integrity sha512-/+S03c8AGsDYKKBtRDqieTJv2GlkMb0bWjnqOgtF6MkjdUQ9a8ARAtxWf9NgKLGm2+WQr6+/tqJdU8HNGsIDoA== - path2d@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/path2d/-/path2d-0.2.2.tgz#cc85d61ed7827e7863a2ee36713d4b5315a3d85d" @@ -9175,14 +9168,6 @@ pathe@1.1.2: resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== -pdfjs-dist@3.11.174: - version "3.11.174" - resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz#5ff47b80f2d58c8dd0d74f615e7c6a7e7e704c4b" - integrity sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA== - optionalDependencies: - canvas "^2.11.2" - path2d-polyfill "^2.0.1" - pdfjs-dist@4.4.168: version "4.4.168" resolved "https://registry.yarnpkg.com/pdfjs-dist/-/pdfjs-dist-4.4.168.tgz#4487716376a33c68753ed37f782ae91d1c9ef8fa"