Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2026-02-27T11:12:11.224Z"
"x-generation-date": "2026-06-10T10:21:11.749Z"
},
"x-strapi-config": {
"plugins": [
Expand Down
23 changes: 18 additions & 5 deletions frontend/src/app/[locale]/projects/[slug]/projectDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,34 @@ type ProjectPageProps = {
};

function getProjectTags(project: ProjectPageData) {
const getTagColor = (tag?: string) => {
if(tag === "en cours") {
return 'bg-resistance'
} else if(tag === "terminé") {
return 'bg-alive'
}
return "bg-back-green"
}

return [
...(project.seasons?.map(season => ({
"label": season.title,
"type": "temporal" as 'temporal' | 'subject'
"type": "temporal" as 'temporal' | 'subject',
"color": "bg-back-green"
})) || []),
{
"label": `${project.start_date ? new Date(project.start_date).toLocaleDateString() : 'N/A'} / ${project.end_date ? new Date(project.end_date).toLocaleDateString() : 'N/A'}`,
"type": "temporal" as 'temporal' | 'subject'
"label": `${(project.start_date && project.end_date) ? `Du ${new Date(project.start_date).toLocaleDateString()} au ${new Date(project.end_date).toLocaleDateString()}` : (project.start_date ? `Depuis le ${new Date(project.start_date).toLocaleDateString()}` : (project.end_date ? `Terminé le ${new Date(project.end_date).toLocaleDateString()}` : 'N/A'))}`,
"type": "temporal" as 'temporal' | 'subject',
"color": "bg-back-green"
}, {
"label": project.state,
"type": "subject" as 'temporal' | 'subject'
"type": "subject" as 'temporal' | 'subject',
"color": getTagColor(project.state)
},
...((project.category as string[])?.map(cat => ({
"label": cat,
"type": "subject" as 'temporal' | 'subject'
"type": "subject" as 'temporal' | 'subject',
"color": "bg-back-green"
})) || [])];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type ProjectPresentationProps = {
tags?: {
label?: string;
type: 'temporal' | 'subject';
color: string;
}[];
description: string[];
associations: {
Expand Down Expand Up @@ -44,7 +45,7 @@ const ProjectPresentation: React.FC<ProjectPresentationProps> = ({
<Title level="p" variant="x-small" className="mb-xs">{t('tags')}</Title>
<ul className="flex flex-row flex-wrap gap-x-1 gap-y-2.5 max-w-96">
{tags.map((tag, index) => (
<li key={index}><Tag color="text-black" bgColor="bg-back-green">{tag.label ?? ''}</Tag></li>
<li key={index}><Tag color="text-black" bgColor={tag.color}>{tag.label ?? ''}</Tag></li>
))}
{thematics?.map((thematic, index) => (
<li key={index}><Tag color="text-black" bgColor={`bg-${thematic.color}`}>{thematic.name ?? ''}</Tag></li>
Expand Down
Loading