fix: tool sorting inconsistencies in home page

This commit is contained in:
Corentin Thomasset 2022-06-02 00:44:23 +02:00
parent f05c8e1dc6
commit 5ab4dd3d4a
No known key found for this signature in database
GPG key ID: DBD997E935996158

View file

@ -9,7 +9,13 @@ useHead({ title: 'IT Tools - Handy online tools for developers' });
<template>
<div class="home-page">
<n-grid x-gap="12" y-gap="12" cols="1 400:2 800:3 1200:4 2000:8">
<n-gi v-for="tool in toolsWithCategory.reverse().sort(({ isNew }) => (isNew ? -1 : 1))" :key="tool.name">
<n-gi
v-for="tool in [
...toolsWithCategory.filter(({ isNew }) => isNew),
...toolsWithCategory.filter(({ isNew }) => !isNew),
]"
:key="tool.name"
>
<tool-card :tool="tool" />
</n-gi>
</n-grid>