ajout de la date et le tri desc par date des projects

This commit is contained in:
toine 2025-10-05 15:30:15 +02:00
parent cdb70ca5ea
commit 80dc10855f
2 changed files with 14 additions and 2 deletions

View file

@ -12,7 +12,8 @@
top: 0;
z-index: 1000;
box-sizing: border-box; /* important pour éviter lélargissement avec le padding */
overflow-x: auto; /* autorise un scroll horizontal si vraiment nécessaire */
overflow-x: hidden; /* empêche toute barre de défilement horizontale */
overflow-y: hidden; /* évite une barre verticale dans le header fixe */
height: var(--header-height, 80px);
transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

View file

@ -1,3 +1,9 @@
interface Project {
id: string;
created_at: number;
// ... autres propriétés
}
async function getProjects() {
const baseUrl = process.env.BACKEND_URL;
if (!baseUrl) {
@ -46,7 +52,9 @@ export default async function ProjectsPage() {
<div className="container">
<h2 className="section-title">Mes projets</h2>
<ul className="projects-list">
{projects.map((p: any) => {
{projects
.sort((a: Project, b: Project) => b.created_at - a.created_at)
.map((p: any) => {
const tags = toTags(p.technologies);
const href = p.link || p.url || '#';
const imgUrl = normalizeImageUrl(p.image);
@ -76,6 +84,9 @@ export default async function ProjectsPage() {
p.technologies ? <span className="badge badge--mono">{String(p.technologies)}</span> : null
)}
</div>
<div>
Crée le {new Date(p.created_at * 1000).toLocaleDateString()}
</div>
</div>
</a>
</li>