From 3d66ddcec1f8eb64f51f48628e5ca2a48442d3d6 Mon Sep 17 00:00:00 2001 From: atrincas Date: Wed, 25 Sep 2024 12:24:48 +0200 Subject: [PATCH 1/8] Moved newsletter to dialog --- src/app/(static)/layout.tsx | 2 -- src/components/app-menu/content.tsx | 48 ++++++++++++++++++++++++++--- src/containers/header/index.tsx | 2 +- src/containers/newsletter/index.tsx | 12 ++------ 4 files changed, 46 insertions(+), 18 deletions(-) diff --git a/src/app/(static)/layout.tsx b/src/app/(static)/layout.tsx index ce7c8f0..2d9733f 100644 --- a/src/app/(static)/layout.tsx +++ b/src/app/(static)/layout.tsx @@ -1,13 +1,11 @@ import { PropsWithChildren } from 'react'; import Footer from '@/containers/footer'; -import Newsletter from '@/containers/newsletter'; export default function StaticPageLayout({ children }: Readonly) { return (
{children} -
); diff --git a/src/components/app-menu/content.tsx b/src/components/app-menu/content.tsx index 7fa5972..61008f0 100644 --- a/src/components/app-menu/content.tsx +++ b/src/components/app-menu/content.tsx @@ -12,19 +12,55 @@ import { menuOpenAtom } from '@/app/store'; import { SECTIONS } from '@/containers/header'; -const NavItem = (props: PropsWithChildren) => { +import Newsletter from '../../containers/newsletter'; +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '../ui/dialog'; + +const navItemContainerClass = + 'hover:text-navy-500 relative inline-flex items-center space-x-6 text-xl text-grey-800 2xl:text-4xl' as const; +const NavItem = (props: PropsWithChildren) => { const setOpen = useSetAtom(menuOpenAtom); + const Text = ( + <> + {props.children} + + + ); + + if (props.isDialogButton) { + return ( + + + + + + + + Interested in our work? + + + + + + ); + } return ( { setOpen(false); }} > - {props.children} - + {Text} ); }; @@ -89,7 +125,9 @@ export const Nav = () => {
    {SECTIONS.map((item) => (
  • - {item.name} + + {item.name} +
  • ))}
diff --git a/src/containers/header/index.tsx b/src/containers/header/index.tsx index e3ced68..e0b470e 100644 --- a/src/containers/header/index.tsx +++ b/src/containers/header/index.tsx @@ -15,7 +15,7 @@ export const SECTIONS = [ { name: 'Cases', href: '/cases' }, { name: 'Events & News', href: '/events-news' }, { name: 'Contact us', href: '#contact-us' }, -]; +] as const; export default function Header({ className, diff --git a/src/containers/newsletter/index.tsx b/src/containers/newsletter/index.tsx index b0fe15d..0adfdf5 100644 --- a/src/containers/newsletter/index.tsx +++ b/src/containers/newsletter/index.tsx @@ -120,17 +120,9 @@ export default function Newsletter() { ); return ( -
-

- Interested in environmental conservation? -

- +
- +
Date: Wed, 25 Sep 2024 12:31:46 +0200 Subject: [PATCH 2/8] Added changes to case-studies data --- src/data/case-studies.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/case-studies.ts b/src/data/case-studies.ts index 9f60ed7..af95077 100644 --- a/src/data/case-studies.ts +++ b/src/data/case-studies.ts @@ -15,14 +15,14 @@ export const CASE_STUDIES: CaseStudy[] = [ location: { continent: Continent.EUROPE, country: { - name: 'Portugal', - code: 'PT', + name: 'Denmark', + code: 'DK', }, coordinates: { type: 'Feature', geometry: { type: 'Point', - coordinates: [9.441795399183874, 55.984683236682784], + coordinates: [8.500257454233855, 57.00032630290456], }, properties: { id: '1', @@ -134,8 +134,8 @@ export const CASE_STUDIES: CaseStudy[] = [ location: { continent: Continent.EUROPE, country: { - name: 'Denmark', - code: 'DK', + name: 'Portugal', + code: 'PT', }, coordinates: { type: 'Feature', From 70d891bd6ed312520e8dd2e5d469d2a8c497d22c Mon Sep 17 00:00:00 2001 From: atrincas Date: Wed, 25 Sep 2024 12:39:48 +0200 Subject: [PATCH 3/8] Content changes --- src/containers/about/description/index.tsx | 23 +++++++++++----------- src/containers/home/goals/index.tsx | 7 ++++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/containers/about/description/index.tsx b/src/containers/about/description/index.tsx index 40134f1..d6fa909 100644 --- a/src/containers/about/description/index.tsx +++ b/src/containers/about/description/index.tsx @@ -34,9 +34,8 @@ export default function AboutDescription() {

- more4nature is a Horizon Europe project funded under Food, Bioeconomy Natural Resources, - Agriculture and Environment that started in January 2024, ending in December 2027, - formed by a consortium of 21 partners and led by IHE Delft. + more4nature is a Horizon Europe project that started in January 2024, ending in December + 2027, formed by a consortium of 21 partners and led by IHE Delft.

@@ -52,15 +51,15 @@ export default function AboutDescription() { Project structure

- P1 is dedicated to the social aspects of empowering citizens and citizen science - initiatives in collaborative environmental compliance assurance, while WP2 deals - with the technical dimensions of these changes. Both WPs support WP3 which - implements 40 cases (in Europe, Latin America, Asia and Africa) on collaborative - environmental compliance assurance for zero pollution, biodiversity protection - and deforestation prevention in Europe and abroad. In addition, we selected - LivingLabs and Fab Labs across Europe. WP4 supports the creation of impact via - the broad communication, dissemination and exploitation of more4nature results - to specific target audiences. + WP1 is dedicated to the social aspects of empowering citizens and citizen + science initiatives in collaborative environmental compliance assurance, while + WP2 deals with the technical dimensions of these changes. Both WPs support WP3 + which implements 40 cases (in Europe, Latin America, Asia and Africa) on + collaborative environmental compliance assurance for zero pollution, + biodiversity protection and deforestation prevention in Europe and abroad. In + addition, we selected LivingLabs and Fab Labs across Europe. WP4 supports the + creation of impact via the broad communication, dissemination and exploitation + of more4nature results to specific target audiences.

To discover more about EU research results,{' '} diff --git a/src/containers/home/goals/index.tsx b/src/containers/home/goals/index.tsx index 7fa9539..ee30c6a 100644 --- a/src/containers/home/goals/index.tsx +++ b/src/containers/home/goals/index.tsx @@ -21,9 +21,10 @@ export default function Goals() {

more4nature aim

- more4nature aims to bring about transformative change in environmental protection by - including citizens and communities as key actors in collaborative environmental - compliance assurance. + more4nature aims to bring about{' '} + transformative change in environmental + protection by including citizens and communities as key actors in collaborative + environmental compliance assurance.

From cd40404ebd7f41a85d5228f623f4b2342973e6d6 Mon Sep 17 00:00:00 2001 From: atrincas Date: Wed, 25 Sep 2024 14:22:50 +0200 Subject: [PATCH 4/8] Added sortByDate --- src/lib/events.service.ts | 4 +- src/lib/news.service.ts | 5 +- src/lib/utils.ts | 16 ++ tests/events/case-studies.service.test.ts | 20 +-- tests/events/events.service.test.ts | 170 +++++++++++----------- tests/events/news.service.test.ts | 61 ++++---- 6 files changed, 150 insertions(+), 126 deletions(-) diff --git a/src/lib/events.service.ts b/src/lib/events.service.ts index f92358b..9a192ec 100644 --- a/src/lib/events.service.ts +++ b/src/lib/events.service.ts @@ -3,6 +3,8 @@ import { URLink } from '@/lib/case-studies.service'; import { Paginator } from '@/lib/paginator'; +import { sortByDate } from './utils'; + export type Event = { id: string; title: string; @@ -45,7 +47,7 @@ export class EventsService extends Paginator { } getPastEvents(): Event[] { - const pastEvents = this.events.filter((event) => event.date <= this.currentDate); + const pastEvents = sortByDate(this.events.filter((event) => event.date <= this.currentDate)); return this.filter(pastEvents, this.filters); } diff --git a/src/lib/news.service.ts b/src/lib/news.service.ts index b1ceb3b..80f8562 100644 --- a/src/lib/news.service.ts +++ b/src/lib/news.service.ts @@ -1,6 +1,8 @@ import { ThematicArea } from '@/lib/case-studies.service'; import { Paginator, SearchParams, PaginatedResult } from '@/lib/paginator'; +import { sortByDate } from './utils'; + export type News = { name: string; date: string; @@ -29,7 +31,8 @@ export class NewsService extends Paginator { } public searchNews(): PaginatedResult { - const filteredItems = this.filter(this.items); + const filteredItems = sortByDate(this.filter(this.items)); + return this.paginate(filteredItems); } diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 9ad0df4..02185f0 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,6 +1,22 @@ import { type ClassValue, clsx } from 'clsx'; import { twMerge } from 'tailwind-merge'; +import { Event } from './events.service'; +import { News } from './news.service'; + export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } + +export function sortByDate(data: T[], order: 'ASC' | 'DESC' = 'DESC'): T[] { + return data.sort(function (a, b) { + const dateA = new Date(a.date).getTime(); + const dateB = new Date(b.date).getTime(); + + if (order === 'ASC') { + return dateA - dateB; + } else { + return dateB - dateA; + } + }); +} diff --git a/tests/events/case-studies.service.test.ts b/tests/events/case-studies.service.test.ts index 8301c33..708b700 100644 --- a/tests/events/case-studies.service.test.ts +++ b/tests/events/case-studies.service.test.ts @@ -828,14 +828,14 @@ describe('CaseStudyService', () => { location: { continent: 'Europe', country: { - name: 'Portugal', - code: 'PT', + name: 'Denmark', + code: 'DK', }, coordinates: { type: 'Feature', geometry: { type: 'Point', - coordinates: [9.441795399183874, 55.984683236682784], + coordinates: [8.500257454233855, 57.00032630290456], }, properties: { id: '1', @@ -940,8 +940,8 @@ describe('CaseStudyService', () => { location: { continent: 'Europe', country: { - name: 'Denmark', - code: 'DK', + name: 'Portugal', + code: 'PT', }, coordinates: { type: 'Feature', @@ -1623,14 +1623,14 @@ describe('CaseStudyService', () => { location: { continent: 'Europe', country: { - name: 'Portugal', - code: 'PT', + name: 'Denmark', + code: 'DK', }, coordinates: { type: 'Feature', geometry: { type: 'Point', - coordinates: [9.441795399183874, 55.984683236682784], + coordinates: [8.500257454233855, 57.00032630290456], }, properties: { id: '1', @@ -1735,8 +1735,8 @@ describe('CaseStudyService', () => { location: { continent: 'Europe', country: { - name: 'Denmark', - code: 'DK', + name: 'Portugal', + code: 'PT', }, coordinates: { type: 'Feature', diff --git a/tests/events/events.service.test.ts b/tests/events/events.service.test.ts index 8f9d660..e9213c9 100644 --- a/tests/events/events.service.test.ts +++ b/tests/events/events.service.test.ts @@ -46,49 +46,33 @@ describe('EventsService', () => { url: 'https://www.pollinet.pt/?pgid=lxer1xkc-0cdd2b4b-2b57-4b57-b20d-52c5492603b8', }, }, + { - id: '2', - title: 'Seagrass and Pollution', - type: 'Seminar', + id: '5', + title: 'Earth Day Workshop, Single Use Plastics Directive', + type: 'International Days', theme: 'Pollution', presenters: [ - 'Rita Hagan - Coastwatch CS Coordinator', - 'Mick Berry - Coastwatch CS Coordinator', - 'Marcial Bardolet - IBANAT, Government of the Balearic Islands & Mediterranean Posidonia Network', - 'Prof. Bissswajit Bazu - Civil, Structural & Environmental Engineering TCD', - 'Jody Power - Mayor of Waterford', - 'Prof Iris Moeller - Head of Geography, Trinity College Dublin (TCD)', - 'Fintan Kelly - Policy officer, Irish Environmental Network', - 'Dr. Robert Wilkes - EPA', - 'Tim Butter - Cork SubAqua Club', + 'Colm Lambert - DECC', + 'Jarlath T Duffy - EPA', + 'Karin Dubky - Coaswatch', + 'Will Mitchel - Mywaste.ie', + 'Bernie Connolly - Coastwatch', + 'Cecilia Harrington - Harrington Solicitors', + 'Gaëlle Haut - Surfrider Foundation', + 'Maya Galante - NEU Boston', + 'Johnny Dabrowski - TCD & Earthday.org', + 'Barbara Nolan - Head of EC Representation in Ireland', ], - organizations: ['FCID/Ciências ULisboa'], - description: - '

From Coastwatch FB “[Our] seminar yesterday in partnership with Irish Environmental Network & Trinity College Dublin on Coastal Nature Protection, Management & Restoration with a focus on Seagrass & the Nature Restoration Law

Thank you to everyone who attended and to all of our wonderful presenters, especially Marcial Bardolet Govern de les Illes Balears who traveled from Spain to be with us and gave such an inspiring example of a country that does protect all of its seagrass.

Thanks also to workshop facilitators, legal experts and rapporteurs, and all who helped with organising as well as our hosts in the Department of Engineering, Trinity College Dublin & of course our Coastwatchers from all around the island who contribute so much to the citizen science work of Coastwatch.”

', - date: '2024-01-01', - formatDate: 'LLLL, yyyy', - image: '/images/events/town.webp', - location: 'Dublin, Ireland', - link: { - title: '', - url: 'https://www.facebook.com/share/p/ZGCbMeZDogJFgN5M/', - }, - }, - { - id: '3', - title: 'Joint Oireachteas Agriculture Committee on Nitrates', - type: 'Policy', - theme: 'Pollution', - presenters: ['Karin Dubsky', 'Bernie Connolly'], organizations: ['Coastwatch'], description: - '

Presenting at the Joint Oireachtas Committee on Agriculture on "Compliance with the Nitrates Directive: Implications for Ireland."

', - date: '2024-02-01', + '

The UN themed Earth Day 2024 around plastics. To mark the day, Coastwatch organised a workshop on Banned Single Use Plastics in the European Commission Representation of Ireland offices in Dublin and online.

', + date: '2024-04-22', image: '/images/events/town.webp', location: 'Dublin, Ireland', link: { title: '', - url: 'https://x.com/swanireland/status/1760359066319135069', + url: 'https://www.coastwatch.org/post/single-use-plastics-directive-earth-day-2024-workshop-report', }, }, { @@ -118,31 +102,48 @@ describe('EventsService', () => { }, }, { - id: '5', - title: 'Earth Day Workshop, Single Use Plastics Directive', - type: 'International Days', + id: '3', + title: 'Joint Oireachteas Agriculture Committee on Nitrates', + type: 'Policy', + theme: 'Pollution', + presenters: ['Karin Dubsky', 'Bernie Connolly'], + organizations: ['Coastwatch'], + description: + '

Presenting at the Joint Oireachtas Committee on Agriculture on "Compliance with the Nitrates Directive: Implications for Ireland."

', + date: '2024-02-01', + image: '/images/events/town.webp', + location: 'Dublin, Ireland', + link: { + title: '', + url: 'https://x.com/swanireland/status/1760359066319135069', + }, + }, + { + id: '2', + title: 'Seagrass and Pollution', + type: 'Seminar', theme: 'Pollution', presenters: [ - 'Colm Lambert - DECC', - 'Jarlath T Duffy - EPA', - 'Karin Dubky - Coaswatch', - 'Will Mitchel - Mywaste.ie', - 'Bernie Connolly - Coastwatch', - 'Cecilia Harrington - Harrington Solicitors', - 'Gaëlle Haut - Surfrider Foundation', - 'Maya Galante - NEU Boston', - 'Johnny Dabrowski - TCD & Earthday.org', - 'Barbara Nolan - Head of EC Representation in Ireland', + 'Rita Hagan - Coastwatch CS Coordinator', + 'Mick Berry - Coastwatch CS Coordinator', + 'Marcial Bardolet - IBANAT, Government of the Balearic Islands & Mediterranean Posidonia Network', + 'Prof. Bissswajit Bazu - Civil, Structural & Environmental Engineering TCD', + 'Jody Power - Mayor of Waterford', + 'Prof Iris Moeller - Head of Geography, Trinity College Dublin (TCD)', + 'Fintan Kelly - Policy officer, Irish Environmental Network', + 'Dr. Robert Wilkes - EPA', + 'Tim Butter - Cork SubAqua Club', ], - organizations: ['Coastwatch'], + organizations: ['FCID/Ciências ULisboa'], description: - '

The UN themed Earth Day 2024 around plastics. To mark the day, Coastwatch organised a workshop on Banned Single Use Plastics in the European Commission Representation of Ireland offices in Dublin and online.

', - date: '2024-04-22', + '

From Coastwatch FB “[Our] seminar yesterday in partnership with Irish Environmental Network & Trinity College Dublin on Coastal Nature Protection, Management & Restoration with a focus on Seagrass & the Nature Restoration Law

Thank you to everyone who attended and to all of our wonderful presenters, especially Marcial Bardolet Govern de les Illes Balears who traveled from Spain to be with us and gave such an inspiring example of a country that does protect all of its seagrass.

Thanks also to workshop facilitators, legal experts and rapporteurs, and all who helped with organising as well as our hosts in the Department of Engineering, Trinity College Dublin & of course our Coastwatchers from all around the island who contribute so much to the citizen science work of Coastwatch.”

', + date: '2024-01-01', + formatDate: 'LLLL, yyyy', image: '/images/events/town.webp', location: 'Dublin, Ireland', link: { title: '', - url: 'https://www.coastwatch.org/post/single-use-plastics-directive-earth-day-2024-workshop-report', + url: 'https://www.facebook.com/share/p/ZGCbMeZDogJFgN5M/', }, }, ]); @@ -163,31 +164,31 @@ describe('EventsService', () => { expect(pastEvents).toEqual([ { - id: '2', - title: 'Seagrass and Pollution', - type: 'Seminar', + id: '5', + title: 'Earth Day Workshop, Single Use Plastics Directive', + type: 'International Days', theme: 'Pollution', presenters: [ - 'Rita Hagan - Coastwatch CS Coordinator', - 'Mick Berry - Coastwatch CS Coordinator', - 'Marcial Bardolet - IBANAT, Government of the Balearic Islands & Mediterranean Posidonia Network', - 'Prof. Bissswajit Bazu - Civil, Structural & Environmental Engineering TCD', - 'Jody Power - Mayor of Waterford', - 'Prof Iris Moeller - Head of Geography, Trinity College Dublin (TCD)', - 'Fintan Kelly - Policy officer, Irish Environmental Network', - 'Dr. Robert Wilkes - EPA', - 'Tim Butter - Cork SubAqua Club', + 'Colm Lambert - DECC', + 'Jarlath T Duffy - EPA', + 'Karin Dubky - Coaswatch', + 'Will Mitchel - Mywaste.ie', + 'Bernie Connolly - Coastwatch', + 'Cecilia Harrington - Harrington Solicitors', + 'Gaëlle Haut - Surfrider Foundation', + 'Maya Galante - NEU Boston', + 'Johnny Dabrowski - TCD & Earthday.org', + 'Barbara Nolan - Head of EC Representation in Ireland', ], - organizations: ['FCID/Ciências ULisboa'], + organizations: ['Coastwatch'], description: - '

From Coastwatch FB “[Our] seminar yesterday in partnership with Irish Environmental Network & Trinity College Dublin on Coastal Nature Protection, Management & Restoration with a focus on Seagrass & the Nature Restoration Law

Thank you to everyone who attended and to all of our wonderful presenters, especially Marcial Bardolet Govern de les Illes Balears who traveled from Spain to be with us and gave such an inspiring example of a country that does protect all of its seagrass.

Thanks also to workshop facilitators, legal experts and rapporteurs, and all who helped with organising as well as our hosts in the Department of Engineering, Trinity College Dublin & of course our Coastwatchers from all around the island who contribute so much to the citizen science work of Coastwatch.”

', - date: '2024-01-01', - formatDate: 'LLLL, yyyy', + '

The UN themed Earth Day 2024 around plastics. To mark the day, Coastwatch organised a workshop on Banned Single Use Plastics in the European Commission Representation of Ireland offices in Dublin and online.

', + date: '2024-04-22', image: '/images/events/town.webp', location: 'Dublin, Ireland', link: { title: '', - url: 'https://www.facebook.com/share/p/ZGCbMeZDogJFgN5M/', + url: 'https://www.coastwatch.org/post/single-use-plastics-directive-earth-day-2024-workshop-report', }, }, { @@ -207,32 +208,33 @@ describe('EventsService', () => { url: 'https://x.com/swanireland/status/1760359066319135069', }, }, + { - id: '5', - title: 'Earth Day Workshop, Single Use Plastics Directive', - type: 'International Days', + id: '2', + title: 'Seagrass and Pollution', + type: 'Seminar', theme: 'Pollution', presenters: [ - 'Colm Lambert - DECC', - 'Jarlath T Duffy - EPA', - 'Karin Dubky - Coaswatch', - 'Will Mitchel - Mywaste.ie', - 'Bernie Connolly - Coastwatch', - 'Cecilia Harrington - Harrington Solicitors', - 'Gaëlle Haut - Surfrider Foundation', - 'Maya Galante - NEU Boston', - 'Johnny Dabrowski - TCD & Earthday.org', - 'Barbara Nolan - Head of EC Representation in Ireland', + 'Rita Hagan - Coastwatch CS Coordinator', + 'Mick Berry - Coastwatch CS Coordinator', + 'Marcial Bardolet - IBANAT, Government of the Balearic Islands & Mediterranean Posidonia Network', + 'Prof. Bissswajit Bazu - Civil, Structural & Environmental Engineering TCD', + 'Jody Power - Mayor of Waterford', + 'Prof Iris Moeller - Head of Geography, Trinity College Dublin (TCD)', + 'Fintan Kelly - Policy officer, Irish Environmental Network', + 'Dr. Robert Wilkes - EPA', + 'Tim Butter - Cork SubAqua Club', ], - organizations: ['Coastwatch'], + organizations: ['FCID/Ciências ULisboa'], description: - '

The UN themed Earth Day 2024 around plastics. To mark the day, Coastwatch organised a workshop on Banned Single Use Plastics in the European Commission Representation of Ireland offices in Dublin and online.

', - date: '2024-04-22', + '

From Coastwatch FB “[Our] seminar yesterday in partnership with Irish Environmental Network & Trinity College Dublin on Coastal Nature Protection, Management & Restoration with a focus on Seagrass & the Nature Restoration Law

Thank you to everyone who attended and to all of our wonderful presenters, especially Marcial Bardolet Govern de les Illes Balears who traveled from Spain to be with us and gave such an inspiring example of a country that does protect all of its seagrass.

Thanks also to workshop facilitators, legal experts and rapporteurs, and all who helped with organising as well as our hosts in the Department of Engineering, Trinity College Dublin & of course our Coastwatchers from all around the island who contribute so much to the citizen science work of Coastwatch.”

', + date: '2024-01-01', + formatDate: 'LLLL, yyyy', image: '/images/events/town.webp', location: 'Dublin, Ireland', link: { title: '', - url: 'https://www.coastwatch.org/post/single-use-plastics-directive-earth-day-2024-workshop-report', + url: 'https://www.facebook.com/share/p/ZGCbMeZDogJFgN5M/', }, }, ]); diff --git a/tests/events/news.service.test.ts b/tests/events/news.service.test.ts index 3e9dc99..4e6f5f5 100644 --- a/tests/events/news.service.test.ts +++ b/tests/events/news.service.test.ts @@ -46,20 +46,20 @@ describe('NewsService', () => { expect(result.data).toEqual([ { - name: 'Introduction to more4nature Project', - date: '2024-01-03', + name: 'European Space Agency Environmental Crimes Workshop 2024', + date: '2024-06-11', description: - "

We're excited to launch the more4nature project, focusing on zero pollution, biodiversity protection, and deforestation prevention by empowering citizens and communities. The project aims to bridge the gap between citizen science initiatives (CSIs) and local authorities, enhancing environmental compliance and monitoring. By strengthening CSIs, facilitating collaboration, and developing tools to validate Citizen-Generated Data (CGD), more4nature seeks to make CGD a key part of the Green Deal Data Space, driving green and digital transformations.

", + '

At the JRC and ESA Environmental Crimes Workshop 2024, Joan Maso Pau from CREAF presented a poster on "Empowering Citizens in Collaborative Environmental Compliance Assurance." Joan highlighted how more4nature drove conservation by involving citizens and communities in efforts to achieve zero pollution, protect biodiversity, and prevent deforestation. The presentation covered strengthening Citizen Science Initiatives for reliable data, enhancing collaboration between CSIs and authorities, developing tools for validating and integrating citizen data, incorporating data into the Green Deal Data Space, and fostering synergies with LivingLabs and Fab Labs. We engaged with experts and explored how remote sensing could complement citizen science.

', categories: ['Deforestation Prevention', 'Biodiversity Protection', 'Zero Pollution'], - link: 'https://www.linkedin.com/feed/update/urn:li:activity:7169301090432200704', + link: 'https://www.linkedin.com/feed/update/urn:li:activity:7206272288357298176', }, { - name: 'Leveraging Citizen Science Initiatives', - date: '2024-04-25', + name: 'more4nature Project in Copenhagen!', + date: '2024-05-30', description: - "

It’s exciting to see the discussion on societal engagement and open science. At more4nature, we're actively contributing to this dialogue by empowering citizens and communities in environmental action. Our project is all about leveraging citizen science initiatives (CSIs) to tackle pollution, protect biodiversity, and prevent deforestation.

Citizen involvement and citizen-generated data (CGD) are vital to counter environmental degradation. That's why more4nature is dedicated to bridging the gap between CSIs and authorities. By strengthening CSIs, facilitating collaboration, and developing tools for validating CGD, we ensure that valuable data doesn't go to waste.

", + '

Our team is thrilled to reunite in Copenhagen, advancing transformative conservation efforts by integrating citizens and citizen science initiatives into environmental compliance. Discussions with European Environment Agency (EEA) experts highlighted shared interests in using Citizen-Generated Data for monitoring at national and regional levels.

We explored links between health, pollution, and the need for better data on issues like microplastics. More4nature partner Ida Theilade emphasized, "Citizens can play a role because they know what to look for," despite challenges like illegal logging.

', categories: ['Deforestation Prevention', 'Biodiversity Protection', 'Zero Pollution'], - link: 'https://www.linkedin.com/feed/update/urn:li:activity:7189277848879124481', + link: 'https://www.linkedin.com/feed/update/urn:li:activity:7201890677780041728', }, { name: 'Earth Day Workshop with Coastwatch', @@ -70,20 +70,20 @@ describe('NewsService', () => { link: 'https://www.linkedin.com/feed/update/urn:li:activity:7189583716824854528', }, { - name: 'more4nature Project in Copenhagen!', - date: '2024-05-30', + name: 'Leveraging Citizen Science Initiatives', + date: '2024-04-25', description: - '

Our team is thrilled to reunite in Copenhagen, advancing transformative conservation efforts by integrating citizens and citizen science initiatives into environmental compliance. Discussions with European Environment Agency (EEA) experts highlighted shared interests in using Citizen-Generated Data for monitoring at national and regional levels.

We explored links between health, pollution, and the need for better data on issues like microplastics. More4nature partner Ida Theilade emphasized, "Citizens can play a role because they know what to look for," despite challenges like illegal logging.

', + "

It’s exciting to see the discussion on societal engagement and open science. At more4nature, we're actively contributing to this dialogue by empowering citizens and communities in environmental action. Our project is all about leveraging citizen science initiatives (CSIs) to tackle pollution, protect biodiversity, and prevent deforestation.

Citizen involvement and citizen-generated data (CGD) are vital to counter environmental degradation. That's why more4nature is dedicated to bridging the gap between CSIs and authorities. By strengthening CSIs, facilitating collaboration, and developing tools for validating CGD, we ensure that valuable data doesn't go to waste.

", categories: ['Deforestation Prevention', 'Biodiversity Protection', 'Zero Pollution'], - link: 'https://www.linkedin.com/feed/update/urn:li:activity:7201890677780041728', + link: 'https://www.linkedin.com/feed/update/urn:li:activity:7189277848879124481', }, { - name: 'European Space Agency Environmental Crimes Workshop 2024', - date: '2024-06-11', + name: 'Introduction to more4nature Project', + date: '2024-01-03', description: - '

At the JRC and ESA Environmental Crimes Workshop 2024, Joan Maso Pau from CREAF presented a poster on "Empowering Citizens in Collaborative Environmental Compliance Assurance." Joan highlighted how more4nature drove conservation by involving citizens and communities in efforts to achieve zero pollution, protect biodiversity, and prevent deforestation. The presentation covered strengthening Citizen Science Initiatives for reliable data, enhancing collaboration between CSIs and authorities, developing tools for validating and integrating citizen data, incorporating data into the Green Deal Data Space, and fostering synergies with LivingLabs and Fab Labs. We engaged with experts and explored how remote sensing could complement citizen science.

', + "

We're excited to launch the more4nature project, focusing on zero pollution, biodiversity protection, and deforestation prevention by empowering citizens and communities. The project aims to bridge the gap between citizen science initiatives (CSIs) and local authorities, enhancing environmental compliance and monitoring. By strengthening CSIs, facilitating collaboration, and developing tools to validate Citizen-Generated Data (CGD), more4nature seeks to make CGD a key part of the Green Deal Data Space, driving green and digital transformations.

", categories: ['Deforestation Prevention', 'Biodiversity Protection', 'Zero Pollution'], - link: 'https://www.linkedin.com/feed/update/urn:li:activity:7206272288357298176', + link: 'https://www.linkedin.com/feed/update/urn:li:activity:7169301090432200704', }, ]); }); @@ -96,19 +96,20 @@ describe('NewsService', () => { expect(result.data).toEqual([ { - name: 'Introduction to more4nature Project', - date: '2024-01-03', + name: 'Hutsulshchyna Park Team, Part of more4nature Project, Raises Awareness on Forest Reforms in Carpathian National Park', + date: '2024-07-03', description: - "

We're excited to launch the more4nature project, focusing on zero pollution, biodiversity protection, and deforestation prevention by empowering citizens and communities. The project aims to bridge the gap between citizen science initiatives (CSIs) and local authorities, enhancing environmental compliance and monitoring. By strengthening CSIs, facilitating collaboration, and developing tools to validate Citizen-Generated Data (CGD), more4nature seeks to make CGD a key part of the Green Deal Data Space, driving green and digital transformations.

", - categories: ['Deforestation Prevention', 'Biodiversity Protection', 'Zero Pollution'], - link: 'https://www.linkedin.com/feed/update/urn:li:activity:7169301090432200704', + '

On June 25, representatives from Hutsulshchyna National Nature Park, part of the more4nature project by the National Ecological Centre of Ukraine, visited the Carpathian National Nature Park in Yaremche. The event aimed to raise awareness about forest management reforms and illegal logging, engaging 75 local citizens in discussions. Later, the delegation also visited Vorokhta and the Vorokhta Forest Management Branch, presenting the more4nature project and surveying 30 forestry workers. The day was highly productive and informative for all involved.

', + categories: [ThematicArea.DEFORESTATION_PREVENTION], + link: 'https://www.linkedin.com/feed/update/urn:li:activity:7214292712999546880', }, { - name: 'Project Kick-Off at IHE Delft Institute for Water Education', - date: '2024-03-21', + name: 'Portuguese Minister Emphasizes Vital Role of Pollinators in National Action Plan: Spotlight on the PolinizAÇÃO Project', + date: '2024-06-27', description: - '

Following the project Kick-Off at IHE Delft Institute for Water Education in Delft, some more4nature partners got up close and personal with some of the natural beauty that they hope to protect in the course of the project lifetime, in Europe, Africa, Asia and Latin America. Watch the video to find out more!

', - categories: ['Biodiversity Protection'], + "

Exciting news on the EU's Nature Restoration Law! Portuguese Minister Maria Da Graça Carvalho recently emphasized the importance of protecting pollinators, highlighting the Action Plan led by Universidade de Coimbra and featured in more4nature's case studies. This plan aims to combat pollinator decline through improved conservation efforts, data collection via citizen science, and increased public awareness. PolinizAÇÃO, part of polli.NET and coordinated by the FLOWer Lab, is a key initiative in this effort. Kudos to more4nature partners Cristina Luís and Esther Marín González for their work on this crucial Biodiversity Protection case.

", + categories: [ThematicArea.BIODIVERSITY_PROTECTION], + link: 'https://www.linkedin.com/feed/update/urn:li:activity:7212008106069766144', }, ]); expect(result.total).toBe(10); @@ -124,12 +125,12 @@ describe('NewsService', () => { expect(result.data).toEqual([ { - name: 'Introduction to more4nature Project', - date: '2024-01-03', + name: 'Hutsulshchyna Park Team, Part of more4nature Project, Raises Awareness on Forest Reforms in Carpathian National Park', + date: '2024-07-03', description: - "

We're excited to launch the more4nature project, focusing on zero pollution, biodiversity protection, and deforestation prevention by empowering citizens and communities. The project aims to bridge the gap between citizen science initiatives (CSIs) and local authorities, enhancing environmental compliance and monitoring. By strengthening CSIs, facilitating collaboration, and developing tools to validate Citizen-Generated Data (CGD), more4nature seeks to make CGD a key part of the Green Deal Data Space, driving green and digital transformations.

", - categories: ['Deforestation Prevention', 'Biodiversity Protection', 'Zero Pollution'], - link: 'https://www.linkedin.com/feed/update/urn:li:activity:7169301090432200704', + '

On June 25, representatives from Hutsulshchyna National Nature Park, part of the more4nature project by the National Ecological Centre of Ukraine, visited the Carpathian National Nature Park in Yaremche. The event aimed to raise awareness about forest management reforms and illegal logging, engaging 75 local citizens in discussions. Later, the delegation also visited Vorokhta and the Vorokhta Forest Management Branch, presenting the more4nature project and surveying 30 forestry workers. The day was highly productive and informative for all involved.

', + categories: [ThematicArea.DEFORESTATION_PREVENTION], + link: 'https://www.linkedin.com/feed/update/urn:li:activity:7214292712999546880', }, ]); expect(result.total).toBe(5); From 1b1c02a4920d529d93a6be71efbd48cb00abd674 Mon Sep 17 00:00:00 2001 From: atrincas Date: Wed, 25 Sep 2024 14:41:38 +0200 Subject: [PATCH 5/8] Bugfixes responsiveness --- src/containers/home/intro/index.tsx | 2 +- src/containers/home/thematic-areas/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/containers/home/intro/index.tsx b/src/containers/home/intro/index.tsx index c8bb3f3..a6e4c32 100644 --- a/src/containers/home/intro/index.tsx +++ b/src/containers/home/intro/index.tsx @@ -42,7 +42,7 @@ export default function Intro() {

Reversing the trend in environmental degradation through{' '} collaboration of{' '} - + citizen science initiatives with authorities.

diff --git a/src/containers/home/thematic-areas/index.tsx b/src/containers/home/thematic-areas/index.tsx index e96add7..e21bc78 100644 --- a/src/containers/home/thematic-areas/index.tsx +++ b/src/containers/home/thematic-areas/index.tsx @@ -106,7 +106,7 @@ export default function ThematicAreas() {
{icon} - {name} + {name}
{description} From dcd6da8cd4688fe6f687b33b74345d41194487a0 Mon Sep 17 00:00:00 2001 From: atrincas Date: Wed, 25 Sep 2024 14:57:43 +0200 Subject: [PATCH 6/8] Refactor sort by date function --- src/lib/events.service.ts | 6 ++++-- src/lib/news.service.ts | 4 ++-- src/lib/utils.ts | 13 ++----------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/lib/events.service.ts b/src/lib/events.service.ts index 9a192ec..d6112ee 100644 --- a/src/lib/events.service.ts +++ b/src/lib/events.service.ts @@ -3,7 +3,7 @@ import { URLink } from '@/lib/case-studies.service'; import { Paginator } from '@/lib/paginator'; -import { sortByDate } from './utils'; +import { sortByDateDescending } from './utils'; export type Event = { id: string; @@ -47,7 +47,9 @@ export class EventsService extends Paginator { } getPastEvents(): Event[] { - const pastEvents = sortByDate(this.events.filter((event) => event.date <= this.currentDate)); + const pastEvents = sortByDateDescending( + this.events.filter((event) => event.date <= this.currentDate), + ); return this.filter(pastEvents, this.filters); } diff --git a/src/lib/news.service.ts b/src/lib/news.service.ts index 80f8562..16a4950 100644 --- a/src/lib/news.service.ts +++ b/src/lib/news.service.ts @@ -1,7 +1,7 @@ import { ThematicArea } from '@/lib/case-studies.service'; import { Paginator, SearchParams, PaginatedResult } from '@/lib/paginator'; -import { sortByDate } from './utils'; +import { sortByDateDescending } from './utils'; export type News = { name: string; @@ -31,7 +31,7 @@ export class NewsService extends Paginator { } public searchNews(): PaginatedResult { - const filteredItems = sortByDate(this.filter(this.items)); + const filteredItems = sortByDateDescending(this.filter(this.items)); return this.paginate(filteredItems); } diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 02185f0..4fa6ee2 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -8,15 +8,6 @@ export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } -export function sortByDate(data: T[], order: 'ASC' | 'DESC' = 'DESC'): T[] { - return data.sort(function (a, b) { - const dateA = new Date(a.date).getTime(); - const dateB = new Date(b.date).getTime(); - - if (order === 'ASC') { - return dateA - dateB; - } else { - return dateB - dateA; - } - }); +export function sortByDateDescending(data: T[]): T[] { + return data.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime()); } From 842bc1c5cee1cb08dc4322b432f90920eb54685b Mon Sep 17 00:00:00 2001 From: atrincas Date: Wed, 25 Sep 2024 17:59:58 +0200 Subject: [PATCH 7/8] Added more changes --- src/components/app-menu/content.tsx | 12 +- src/containers/about/description/index.tsx | 2 +- src/containers/about/partners/index.tsx | 4 - src/containers/case-detail/sidebar/index.tsx | 170 +++++++------------ src/containers/footer/index.tsx | 6 +- src/lib/events.service.ts | 3 +- src/lib/news.service.ts | 3 +- 7 files changed, 73 insertions(+), 127 deletions(-) diff --git a/src/components/app-menu/content.tsx b/src/components/app-menu/content.tsx index 61008f0..a7d8914 100644 --- a/src/components/app-menu/content.tsx +++ b/src/components/app-menu/content.tsx @@ -11,9 +11,15 @@ import { cn } from '@/lib/utils'; import { menuOpenAtom } from '@/app/store'; import { SECTIONS } from '@/containers/header'; +import Newsletter from '@/containers/newsletter'; -import Newsletter from '../../containers/newsletter'; -import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '../ui/dialog'; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, +} from '@/components/ui/dialog'; const navItemContainerClass = 'hover:text-navy-500 relative inline-flex items-center space-x-6 text-xl text-grey-800 2xl:text-4xl' as const; @@ -40,7 +46,7 @@ const NavItem = (props: PropsWithChildren
- + Interested in our work? diff --git a/src/containers/about/description/index.tsx b/src/containers/about/description/index.tsx index d6fa909..1e75558 100644 --- a/src/containers/about/description/index.tsx +++ b/src/containers/about/description/index.tsx @@ -39,7 +39,7 @@ export default function AboutDescription() {

- more4nature (10.3030/101133983) is structured into work packages that reflect the  + more4nature is structured into work packages that reflect the  socio-technical approach of the project.

diff --git a/src/containers/about/partners/index.tsx b/src/containers/about/partners/index.tsx index 5e26f82..2ff9138 100644 --- a/src/containers/about/partners/index.tsx +++ b/src/containers/about/partners/index.tsx @@ -21,10 +21,6 @@ export default function Partners() { return (

Partners

-

- The more4nature activities are focused on three key thematic areas in environmental - protection: -

The multidisciplinary more4nature consortium brings together a unique combination of collaborations, with scientific experts from the social sciences, data science and diff --git a/src/containers/case-detail/sidebar/index.tsx b/src/containers/case-detail/sidebar/index.tsx index bef1976..bc2a910 100644 --- a/src/containers/case-detail/sidebar/index.tsx +++ b/src/containers/case-detail/sidebar/index.tsx @@ -77,6 +77,35 @@ export default function CaseDetailSidebar() { if (!isSuccess) return null; + const accordionItems = [ + { + value: 'citizenScienceData', + title: 'Citizen Science Data', + data: data?.citizenScienceData || [], + }, + { + value: 'complianceNeed', + title: 'Compliance Need', + data: data?.complianceNeed || [], + }, + // Add these when needed: + // { + // value: 'citizenScienceInitiatives', + // title: 'Citizen Science Initiatives', + // data: data?.citizenScienceInitiatives, + // }, + // { + // value: 'stakeholders', + // title: 'Stakeholders', + // data: data?.stakeholders, + // }, + // { + // value: 'authorities', + // title: 'Authorities', + // data: data?.authorities, + // }, + ]; + return (

- - -
- Citizen Science Initiatives -
-
- -
    - {data?.citizenScienceInitiatives.map((item, index) => ( -
  • {renderItem(item)}
  • - ))} -
-
-
- - -
- Citizen Science Data -
-
- -
    - {data?.citizenScienceData.map((item, index) => ( -
  • {renderItem(item)}
  • - ))} -
-
-
- - -
- Compliance Need -
-
- -
    - {data?.complianceNeed.map((item, index) => ( -
  • - {typeof item === 'object' && 'impact' in item ? ( - <> -

    {item.impact.name}

    -
      - {item.impact.list.map((subItem, index) => ( -
    • {renderItem(subItem)}
    • - ))} -
    - - ) : ( - renderItem(item) - )} -
  • - ))} -
-
-
- - -
- Stakeholders -
-
- -
    - {data?.stakeholders.map((item, index) => ( -
  • - {typeof item === 'object' && 'impact' in item ? ( - <> -

    {item.impact.name}

    -
      - {item.impact.list.map((subItem, index) => ( -
    • {renderItem(subItem)}
    • - ))} -
    - - ) : ( - renderItem(item) - )} -
  • - ))} -
-
-
- - -
- Authorities -
-
- -
    - {data?.authorities.map((item, index) => ( -
  • - {typeof item === 'object' && 'impact' in item ? ( - <> -

    {item.impact.name}

    -
      - {item.impact.list.map((subItem, index) => ( -
    • {renderItem(subItem)}
    • - ))} -
    - - ) : ( - renderItem(item) - )} -
  • - ))} -
-
-
+ {accordionItems.map((item) => ( + + + {item.title} + + +
    + {item.data.map((dataItem, index) => ( +
  • + {typeof dataItem === 'object' && 'impact' in dataItem ? ( + <> +

    {dataItem.impact.name}

    +
      + {dataItem.impact.list.map((subItem, subIndex) => ( +
    • {renderItem(subItem)}
    • + ))} +
    + + ) : ( + renderItem(dataItem) + )} +
  • + ))} +
+
+
+ ))}
diff --git a/src/containers/footer/index.tsx b/src/containers/footer/index.tsx index a8eb0e5..63bf8dc 100644 --- a/src/containers/footer/index.tsx +++ b/src/containers/footer/index.tsx @@ -60,8 +60,10 @@ export default function Footer() {

- This project has received funding from the European Union’s Horizon Europe research - and innovation programme under grant agreement No. 101133983. + Co-Funded by the European Union. Views and opinions expressed are however those of + the author(s) only and do not necessarily reflect those of the European Union. + Neither the European Union nor the granting authority can be held responsible for + them.

diff --git a/src/lib/events.service.ts b/src/lib/events.service.ts index d6112ee..37e2b7a 100644 --- a/src/lib/events.service.ts +++ b/src/lib/events.service.ts @@ -2,8 +2,7 @@ import { URLink } from '@/lib/case-studies.service'; import { Paginator } from '@/lib/paginator'; - -import { sortByDateDescending } from './utils'; +import { sortByDateDescending } from '@/lib/utils'; export type Event = { id: string; diff --git a/src/lib/news.service.ts b/src/lib/news.service.ts index 16a4950..4416741 100644 --- a/src/lib/news.service.ts +++ b/src/lib/news.service.ts @@ -1,7 +1,6 @@ import { ThematicArea } from '@/lib/case-studies.service'; import { Paginator, SearchParams, PaginatedResult } from '@/lib/paginator'; - -import { sortByDateDescending } from './utils'; +import { sortByDateDescending } from '@/lib/utils'; export type News = { name: string; From 13b6159432b302c04cd81866f169098383c46093 Mon Sep 17 00:00:00 2001 From: atrincas Date: Thu, 26 Sep 2024 08:40:18 +0200 Subject: [PATCH 8/8] Fixed dialog title visibility --- src/components/app-menu/content.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/app-menu/content.tsx b/src/components/app-menu/content.tsx index a7d8914..77f1858 100644 --- a/src/components/app-menu/content.tsx +++ b/src/components/app-menu/content.tsx @@ -48,7 +48,7 @@ const NavItem = (props: PropsWithChildren - + Interested in our work?