Skip to content

Commit 3cd8601

Browse files
feat: add video component to project page
Ajoute le nouveau composant Strapi video (video.video-embed) sur la page projet. Le composant s'affiche en bas de page et remplace l'ancien embed YouTube brut. Le champ demo_video/demo_video_embed est conservé pour les projets existants. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 043f026 commit 3cd8601

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

backend/src/api/project/content-types/project/schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@
116116
}
117117
}
118118
},
119+
"video": {
120+
"type": "component",
121+
"repeatable": false,
122+
"component": "video.video-embed",
123+
"pluginOptions": {
124+
"i18n": {
125+
"localized": true
126+
}
127+
}
128+
},
119129
"related_projects": {
120130
"type": "relation",
121131
"relation": "oneToMany",

frontend/src/app/[locale]/projects/[slug]/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ async function fetchProjectPageData(slug: string) {
4949
},
5050
seasons: {
5151
populate: '*'
52+
},
53+
video: {
54+
populate: '*'
5255
}
5356
},
5457
},

frontend/src/app/[locale]/projects/[slug]/projectDetail.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ export default function ProjectDetailPage({ project }: ProjectPageProps) {
175175
className="my-lg"
176176
/>}
177177

178+
{project.video && <BannerVideo
179+
url={project.video.url}
180+
format={project.video.orientation as 'paysage' | 'portrait'}
181+
className='my-lg'
182+
/>}
183+
178184
</>
179185
);
180186
}

0 commit comments

Comments
 (0)