From 19c1cd2a6e7e3ab6546404cacf4bf8022c65efed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Tue, 21 May 2024 19:02:25 +0200 Subject: [PATCH] filters fixed --- .../discover-our-journey/component.tsx | 126 +----------------- .../discover-our-journey/slides.tsx | 124 +++++++++++++++++ .../repository/resources/component.tsx | 48 ++++--- .../resources/methodology/component.tsx | 10 +- .../resources/podcast/component.tsx | 6 +- .../resources/releases/constants.ts | 4 +- 6 files changed, 167 insertions(+), 151 deletions(-) create mode 100644 marketing/src/containers/repository/discover-our-journey/slides.tsx diff --git a/marketing/src/containers/repository/discover-our-journey/component.tsx b/marketing/src/containers/repository/discover-our-journey/component.tsx index 427371807..dd203932b 100644 --- a/marketing/src/containers/repository/discover-our-journey/component.tsx +++ b/marketing/src/containers/repository/discover-our-journey/component.tsx @@ -1,5 +1,4 @@ import { FC, useState } from 'react'; -import Image from 'next/image'; import FadeIn from 'components/fade'; import Wrapper from 'containers/wrapper'; @@ -7,132 +6,9 @@ import Carousel from 'components/carousel/component'; import Link from 'next/link'; import Icon from 'components/icon'; -import { AnimatePresence, motion } from 'framer-motion'; import ARROW_SVG from 'svgs/ui/arrow-top-right.svg?sprite'; -type CardTypes = { - thumb: string; - title: string; - description: string; -}; - -const arrow = { - default: { - opacity: 0, - x: -55, - transition: { - duration: 0, - type: 'tween', - delay: 0, - }, - }, - hover: { - opacity: 1, - x: 0, - transition: { - duration: 0.6, - type: 'tween', - }, - }, -}; - -const Card: FC = ({ thumb, title, description }: CardTypes) => ( - - {title} -
{title}
-

{description}

- - - -
-); - -const SLIDES = [ - { - id: '1', - content: ( -
-
- - - -
-
- ), - }, - { - id: '2', - content: ( -
-
- - - -
-
- ), - }, - { - id: '3', - content: ( -
-
- - - -
-
- ), - }, - { - id: '4', - content: ( -
-
- - - -
-
- ), - }, -]; +import { SLIDES } from './slides'; const DiscoverOurJourney: FC = () => { const [slide, setSlide] = useState(0); diff --git a/marketing/src/containers/repository/discover-our-journey/slides.tsx b/marketing/src/containers/repository/discover-our-journey/slides.tsx new file mode 100644 index 000000000..339c4e921 --- /dev/null +++ b/marketing/src/containers/repository/discover-our-journey/slides.tsx @@ -0,0 +1,124 @@ +import { FC } from 'react'; + +import { motion } from 'framer-motion'; +import Image from 'next/image'; + +import Icon from 'components/icon'; + +import ARROW_SVG from 'svgs/ui/arrow-top-right.svg?sprite'; + +type CardTypes = { + thumb: string; + title: string; + description: string; +}; + +const arrow = { + default: { + opacity: 0, + x: -55, + transition: { + duration: 0, + type: 'tween', + delay: 0, + }, + }, + hover: { + opacity: 1, + x: 0, + transition: { + duration: 0.6, + type: 'tween', + }, + }, +}; + +const Card: FC = ({ thumb, title, description }: CardTypes) => ( + + {title} +
{title}
+

{description}

+ + + +
+); + +export const SLIDES = [ + { + id: '1', + content: ( +
+ + + +
+ ), + }, + { + id: '2', + content: ( +
+ + + +
+ ), + }, + { + id: '3', + content: ( +
+ + + +
+ ), + }, + { + id: '4', + content: ( +
+ + + +
+ ), + }, +]; diff --git a/marketing/src/containers/repository/resources/component.tsx b/marketing/src/containers/repository/resources/component.tsx index a02b58a6c..428403101 100644 --- a/marketing/src/containers/repository/resources/component.tsx +++ b/marketing/src/containers/repository/resources/component.tsx @@ -4,9 +4,19 @@ import Methodology from './methodology'; import Webinar from './webinar'; import DatasetReleases from './releases'; import Podcast from './podcast'; +import Wrapper from 'containers/wrapper/component'; -const FILTERS = ['all', 'methodology', 'dataset-releases', 'webinar-and-podcasts', 'blogs']; -const FILTERS_DICTIONARY = { +type FilterType = 'all' | 'methodology' | 'dataset-releases' | 'webinar-and-podcasts' | 'blogs'; + +const FILTERS: FilterType[] = [ + 'all', + 'methodology', + 'dataset-releases', + 'webinar-and-podcasts', + 'blogs', +]; + +const FILTERS_DICTIONARY: Record = { all: 'All', methodology: 'Methodology', 'dataset-releases': 'Dataset releases', @@ -18,23 +28,25 @@ const Resources: React.FC = () => { const [filter, setFilter] = useState('all'); return ( -
-
- Filter by: -
- {FILTERS.map((f) => ( - - ))} +
+ +
+ Filter by: +
+ {FILTERS.map((f) => ( + + ))} +
-
+ {(filter === 'all' || filter === 'methodology') && } {(filter === 'all' || filter === 'dataset-releases') && } {(filter === 'all' || filter === 'webinar-and-podcasts') && } diff --git a/marketing/src/containers/repository/resources/methodology/component.tsx b/marketing/src/containers/repository/resources/methodology/component.tsx index 78cd8a754..f1ba96981 100644 --- a/marketing/src/containers/repository/resources/methodology/component.tsx +++ b/marketing/src/containers/repository/resources/methodology/component.tsx @@ -23,13 +23,13 @@ const Methodology: React.FC = () => ( October 2023:
- + - Methodology Version 0.2  + Methodology Version 0.2 
@@ -43,11 +43,11 @@ const Methodology: React.FC = () => (
- Methodology Version 0.1 + Methodology Version 0.1  diff --git a/marketing/src/containers/repository/resources/podcast/component.tsx b/marketing/src/containers/repository/resources/podcast/component.tsx index 509870848..9d15ac1a0 100644 --- a/marketing/src/containers/repository/resources/podcast/component.tsx +++ b/marketing/src/containers/repository/resources/podcast/component.tsx @@ -51,7 +51,11 @@ const Webinar: React.FC = () => ( one we are left with.”

- + Listen to the full episode. diff --git a/marketing/src/containers/repository/resources/releases/constants.ts b/marketing/src/containers/repository/resources/releases/constants.ts index 5dcffc8d2..950fbfdd0 100644 --- a/marketing/src/containers/repository/resources/releases/constants.ts +++ b/marketing/src/containers/repository/resources/releases/constants.ts @@ -7,7 +7,7 @@ export const LANDGRIFFON_ANALYSIS = { }, { name: 'Kuzma et al. Aqueduct 4.0: Updated decision-relevant global water risk indicators', - url: 'http://doi.org/10.46830/writn.23.00061', + url: 'https://doi.org/10.46830/writn.23.00061', }, { name: 'McDowell et al. Global Mapping of Freshwater Nutrient Enrichment and Periphyton Growth Potential', @@ -57,7 +57,7 @@ export const DATASET_FOR_EUDR = { datasets: [ { name: 'Bourgoin et al. Global map of forest cover 2020 - version 1.', - url: 'http://data.europa.eu/89h/10d1b337-b7d1-4938-a048-686c8185b290', + url: 'https://data.europa.eu/89h/10d1b337-b7d1-4938-a048-686c8185b290', }, { name: 'Bourgoin et al. Mapping Global Forest Cover of the Year 2020 to Support the EU Regulation on Deforestation-free Supply Chains.',