Skip to content

Commit c5346ed

Browse files
committed
feat: ordering by time (desc)
1 parent aaf7489 commit c5346ed

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/pages/Works/WorksContainer/WorksContainer.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,21 @@ const WorksContainer = () => {
170170
<div className='text'>Ver</div>
171171
</div>
172172
</CustomCursor>
173-
{works.map((work, index) => (
174-
<WorkItem
175-
title={work.title}
176-
description={work.description}
177-
dev={work.dev}
178-
year={dayjs(work.year).format('YYYY')}
179-
panel={work.panel}
180-
type={work.type}
181-
setScale={setScale}
182-
link={work.link}
183-
/>
184-
))}
173+
{works
174+
.sort((a, b) => b.year.getTime() - a.year.getTime())
175+
.map((work, index) => (
176+
<WorkItem
177+
key={index}
178+
title={work.title}
179+
description={work.description}
180+
dev={work.dev}
181+
year={dayjs(work.year).format('YYYY')}
182+
panel={work.panel}
183+
type={work.type}
184+
setScale={setScale}
185+
link={work.link}
186+
/>
187+
))}
185188
</div>
186189
)
187190
}

0 commit comments

Comments
 (0)