Skip to content

Commit

Permalink
Added more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
atrincas committed Sep 25, 2024
1 parent dcd6da8 commit 842bc1c
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 127 deletions.
12 changes: 9 additions & 3 deletions src/components/app-menu/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,7 +46,7 @@ const NavItem = (props: PropsWithChildren<LinkProps & { isDialogButton?: boolean
{Text}
</button>
</DialogTrigger>
<DialogContent className="bg-white text-grey-800" aria-describedby={undefined}>
<DialogContent className="bg-white pt-8 text-grey-800" aria-describedby={undefined}>
<DialogHeader>
<DialogTitle className="text-xl font-bold text-grey-800 md:text-2xl">
Interested in our work?
Expand Down
2 changes: 1 addition & 1 deletion src/containers/about/description/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function AboutDescription() {
</p>
<Separator className="my-4 bg-grey-800/20" />
<p>
more4nature (10.3030/101133983) is structured into work packages that reflect the&nbsp;
more4nature is structured into work packages that reflect the&nbsp;
<span className="font-bold">socio-technical approach</span> of the project.
</p>
<Dialog>
Expand Down
4 changes: 0 additions & 4 deletions src/containers/about/partners/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ export default function Partners() {
return (
<Wrapper className="space-y-10">
<h3 className="text-xl font-semibold">Partners</h3>
<p className="text-lg leading-9">
The more4nature activities are focused on three key thematic areas in environmental
protection:
</p>
<p className="leading-8">
The multidisciplinary more4nature consortium brings together a unique combination of
collaborations, with scientific experts from the social sciences, data science and
Expand Down
170 changes: 57 additions & 113 deletions src/containers/case-detail/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<ScrollArea className="h-full flex-1">
<div
Expand Down Expand Up @@ -124,120 +153,35 @@ export default function CaseDetailSidebar() {
type="single"
collapsible
className="flex w-full flex-col divide-y divide-white/20"
defaultValue={'citizenScienceInitiatives'}
defaultValue={accordionItems[0].value}
>
<AccordionItem
value="citizenScienceInitiatives"
className="peer w-full py-5 first:pt-0"
>
<AccordionTrigger>
<div className="flex items-center space-x-5">
<span className="text-lg font-semibold">Citizen Science Initiatives</span>
</div>
</AccordionTrigger>
<AccordionContent className="leading-9">
<ul>
{data?.citizenScienceInitiatives.map((item, index) => (
<li key={index}>{renderItem(item)}</li>
))}
</ul>
</AccordionContent>
</AccordionItem>
<AccordionItem value="citizenScienceData" className="peer w-full py-5 first:pt-0">
<AccordionTrigger>
<div className="flex items-center space-x-5">
<span className="text-lg font-semibold">Citizen Science Data</span>
</div>
</AccordionTrigger>
<AccordionContent className="leading-9">
<ul>
{data?.citizenScienceData.map((item, index) => (
<li key={index}>{renderItem(item)}</li>
))}
</ul>
</AccordionContent>
</AccordionItem>
<AccordionItem value="complianceNeed" className="peer w-full py-5 first:pt-0">
<AccordionTrigger>
<div className="flex items-center space-x-5">
<span className="text-lg font-semibold">Compliance Need</span>
</div>
</AccordionTrigger>
<AccordionContent className="leading-9">
<ul className="space-y-4">
{data?.complianceNeed.map((item, index) => (
<li key={index}>
{typeof item === 'object' && 'impact' in item ? (
<>
<h4 className="font-semibold">{item.impact.name}</h4>
<ul className="space-y-2">
{item.impact.list.map((subItem, index) => (
<li key={index}>{renderItem(subItem)}</li>
))}
</ul>
</>
) : (
renderItem(item)
)}
</li>
))}
</ul>
</AccordionContent>
</AccordionItem>
<AccordionItem value="stakeholders" className="peer w-full py-5 first:pt-0">
<AccordionTrigger>
<div className="flex items-center space-x-5">
<span className="text-lg font-semibold">Stakeholders</span>
</div>
</AccordionTrigger>
<AccordionContent className="leading-9">
<ul className="space-y-4">
{data?.stakeholders.map((item, index) => (
<li key={index}>
{typeof item === 'object' && 'impact' in item ? (
<>
<h4 className="font-semibold">{item.impact.name}</h4>
<ul className="space-y-2">
{item.impact.list.map((subItem, index) => (
<li key={index}>{renderItem(subItem)}</li>
))}
</ul>
</>
) : (
renderItem(item)
)}
</li>
))}
</ul>
</AccordionContent>
</AccordionItem>
<AccordionItem value="authorities" className="peer w-full py-5 first:pt-0">
<AccordionTrigger>
<div className="flex items-center space-x-5">
<span className="text-lg font-semibold">Authorities</span>
</div>
</AccordionTrigger>
<AccordionContent className="leading-9">
<ul className="space-y-4">
{data?.authorities.map((item, index) => (
<li key={index}>
{typeof item === 'object' && 'impact' in item ? (
<>
<h4 className="font-semibold">{item.impact.name}</h4>
<ul className="space-y-2">
{item.impact.list.map((subItem, index) => (
<li key={index}>{renderItem(subItem)}</li>
))}
</ul>
</>
) : (
renderItem(item)
)}
</li>
))}
</ul>
</AccordionContent>
</AccordionItem>
{accordionItems.map((item) => (
<AccordionItem key={item.value} value={item.value} className="py-5 first:pt-0">
<AccordionTrigger>
<span className="text-lg font-semibold">{item.title}</span>
</AccordionTrigger>
<AccordionContent className="leading-9">
<ul className="space-y-4">
{item.data.map((dataItem, index) => (
<li key={index}>
{typeof dataItem === 'object' && 'impact' in dataItem ? (
<>
<h4 className="font-semibold">{dataItem.impact.name}</h4>
<ul className="space-y-2">
{dataItem.impact.list.map((subItem, subIndex) => (
<li key={subIndex}>{renderItem(subItem)}</li>
))}
</ul>
</>
) : (
renderItem(dataItem)
)}
</li>
))}
</ul>
</AccordionContent>
</AccordionItem>
))}
</Accordion>
<div>
<div className="flex flex-col items-start space-y-5 border-t border-t-white py-9">
Expand Down
6 changes: 4 additions & 2 deletions src/containers/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ export default function Footer() {
<div className="flex flex-col gap-4 md:flex-row">
<div className="h-10 min-w-[72px] bg-[url('/images/flag-of-europe.svg')] bg-contain bg-no-repeat" />
<p className="text-2xs">
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.
</p>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/lib/events.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/lib/news.service.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 842bc1c

Please sign in to comment.