Skip to content

Commit

Permalink
feat: add vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaGOs92 committed Aug 28, 2024
1 parent 486b445 commit 3976acd
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 14 deletions.
Binary file added public/img/formations-en-ligne/e1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/formations-en-ligne/e2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/formations-en-ligne/e3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/formations-en-ligne/e4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/formations-en-ligne/e5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/formations-en-ligne/e6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/formations-en-ligne/e7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 22 additions & 14 deletions src/app/communes/formation-en-ligne/page.tsx
Original file line number Diff line number Diff line change
@@ -1,64 +1,66 @@
import CardWrapper from '@/components/CardWrapper'
import EventCard from '@/components/Events/EventCard'
import Section from '@/components/Section'
import SectionTilesList from '@/components/SectionTilesList'
import VideoMiniature from '@/components/VideoMiniature'
import { getBalEvents } from '@/lib/api-bal-admin'
import { getUpcomingAndPassedEvents, mapEvents } from '@/utils/events'

const videoFormations = [
{
title: 'Épisode 1 : Introduction',
picto: '/img/picto-fr/video.svg',
image: '/img/formations-en-ligne/e1.png',
link: {
href: 'https://peertube.adresse.data.gouv.fr/w/toyKNe4rKyVD7mUovsWLKd',
target: '_blank',
},
tags: ['Base adresse locale'],
},
{
title: 'Épisode 2 : Création',
picto: '/img/picto-fr/video.svg',
image: '/img/formations-en-ligne/e2.png',
link: {
href: 'https://peertube.adresse.data.gouv.fr/w/aNEtMh7fJCzsAPoGkwvFSg',
target: '_blank',
},
tags: ['Base adresse locale'],
},
{
title: 'Épisode 3 : Voies',
picto: '/img/picto-fr/video.svg',
image: '/img/formations-en-ligne/e3.png',
link: {
href: 'https://peertube.adresse.data.gouv.fr/w/rgksUPigy8KWnmx8WFELDN',
target: '_blank',
},
tags: ['Base adresse locale'],
},
{
title: 'Épisode 4 : Numéros',
picto: '/img/picto-fr/video.svg',
image: '/img/formations-en-ligne/e4.png',
link: {
href: 'https://peertube.adresse.data.gouv.fr/w/un73nNp4kQofNkhT38D6YQ',
target: '_blank',
},
tags: ['Base adresse locale'],
},
{
title: 'Épisode 5 : Lieux-dits',
picto: '/img/picto-fr/video.svg',
image: '/img/formations-en-ligne/e5.png',
link: {
href: 'https://peertube.adresse.data.gouv.fr/w/ttnYNTcXtcubCHQX8kHdGt',
target: '_blank',
},
tags: ['Base adresse locale'],
},
{
title: 'Épisode 6 : Publication',
picto: '/img/picto-fr/video.svg',
image: '/img/formations-en-ligne/e6.png',
link: {
href: 'https://peertube.adresse.data.gouv.fr/w/4uU6AHpTe7coPyhskBSANB',
target: '_blank',
},
tags: ['Base adresse locale'],
},
{
title: 'Épisode 7 : Récupération',
image: '/img/formations-en-ligne/e7.png',
link: {
href: 'https://peertube.adresse.data.gouv.fr/w/fdD1tzvPfktHkkVK8p7h5D',
target: '_blank',
},
},
]

Expand All @@ -81,7 +83,13 @@ export default async function FormationEnLignePage() {
))}
</CardWrapper>
</Section>
<SectionTilesList title="Vidéos des formations" data={videoFormations} />
<Section title="Vidéos des formations">
<CardWrapper isSmallCard>
{videoFormations.map((video, index) => (
<VideoMiniature key={index} {...video} />
))}
</CardWrapper>
</Section>
</>
)
}
6 changes: 6 additions & 0 deletions src/components/Events/EventCard.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ export const StyledEventCard = styled.div<{ isPassed?: boolean }>`
h3 {
font-size: 1.5rem;
}
.fr-btn {
&::after {
display: none;
}
}
`
16 changes: 16 additions & 0 deletions src/components/VideoMiniature/VideoMiniature.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use client'

import styled from 'styled-components'

export const StyledWrapper = styled.a`
margin: 10px;
h3 {
font-size: 0.9rem;
font-weight: bold;
margin: 0;
}
&::after {
display: none;
}
`
20 changes: 20 additions & 0 deletions src/components/VideoMiniature/VideoMiniature.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import ResponsiveImage from '../ResponsiveImage'
import { StyledWrapper } from './VideoMiniature.styles'

interface VideoMiniatureProps {
title: string
image: string
link: {
href: string
target: string
}
}

export default function VideoMiniature({ title, image, link }: VideoMiniatureProps) {
return (
<StyledWrapper href={link.href} target={link.target}>
<ResponsiveImage src={image} alt={title} />
<h3>{title}</h3>
</StyledWrapper>
)
}
1 change: 1 addition & 0 deletions src/components/VideoMiniature/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './VideoMiniature'

0 comments on commit 3976acd

Please sign in to comment.