diff --git a/app/videos/config/videos.ts b/app/videos/config/videos.ts index aa96f4c..ffc15fa 100644 --- a/app/videos/config/videos.ts +++ b/app/videos/config/videos.ts @@ -9,10 +9,19 @@ export interface YouTubeVideo { export const videos: YouTubeVideo[] = [ { id: "1", - title: "Comment j'ai créé mon Portfolio avec Next.js", + title: "Une journée avec un développeur web étudiant | vlog dev", thumbnail: "/images/videos/Video1.png", url: "https://youtu.be/xzs5jgJWWVU", - publishedAt: "13/11/2024", + publishedAt: "24-11-2024", + new: false, + }, + { + id: "2", + title: + "On upgrade (un peu) mon setup | Une journée en télétravail d’un alternant", + thumbnail: "/images/videos/Video2.png", + url: "https://youtu.be/xpul90E3VXM?si=kiqaWnQCWnTRpoH8", + publishedAt: "8-12-2024", new: true, }, ]; diff --git a/app/videos/page.tsx b/app/videos/page.tsx index 03df0ae..886b3e7 100644 --- a/app/videos/page.tsx +++ b/app/videos/page.tsx @@ -1,17 +1,28 @@ +import { videos } from "@/app/videos/config/videos"; import { TypographyH2, TypographyP, TypographySmall, } from "@/components/typography"; import { VideoCardBadge } from "@/components/VideoCard"; -import { videos } from "@/app/videos/config/videos"; export default function VideosPage() { + const parseDate = (dateStr: string) => { + const [day, month, year] = dateStr.split("-").map(Number); + return new Date(year, month - 1, day); + }; + + const sortedVideos = [...videos].sort((a, b) => { + const dateA = parseDate(a.publishedAt); + const dateB = parseDate(b.publishedAt); + return dateB.getTime() - dateA.getTime(); + }); + return (