You've already forked AstralRinth
forked from didirus/AstralRinth
feat(frontend): Sort collections by creation date on user pages and dashboard (#3286)
This commit is contained in:
@@ -49,7 +49,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
<nuxt-link
|
<nuxt-link
|
||||||
v-for="collection in orderedCollections"
|
v-for="collection in orderedCollections.sort(
|
||||||
|
(a, b) => new Date(b.created) - new Date(a.created),
|
||||||
|
)"
|
||||||
:key="collection.id"
|
:key="collection.id"
|
||||||
:to="`/collection/${collection.id}`"
|
:to="`/collection/${collection.id}`"
|
||||||
class="universal-card recessed collection"
|
class="universal-card recessed collection"
|
||||||
|
|||||||
@@ -223,7 +223,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="['collections'].includes(route.params.projectType)" class="collections-grid">
|
<div v-if="['collections'].includes(route.params.projectType)" class="collections-grid">
|
||||||
<nuxt-link
|
<nuxt-link
|
||||||
v-for="collection in collections"
|
v-for="collection in collections.sort(
|
||||||
|
(a, b) => new Date(b.created) - new Date(a.created),
|
||||||
|
)"
|
||||||
:key="collection.id"
|
:key="collection.id"
|
||||||
:to="`/collection/${collection.id}`"
|
:to="`/collection/${collection.id}`"
|
||||||
class="card collection-item"
|
class="card collection-item"
|
||||||
@@ -242,7 +244,12 @@
|
|||||||
{{ collection.description }}
|
{{ collection.description }}
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-bar">
|
<div class="stat-bar">
|
||||||
<div class="stats"><BoxIcon /> {{ collection.projects?.length || 0 }} projects</div>
|
<div class="stats">
|
||||||
|
<BoxIcon />
|
||||||
|
{{
|
||||||
|
`${$formatNumber(collection.projects?.length || 0, false)} project${(collection.projects?.length || 0) !== 1 ? "s" : ""}`
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
<div class="stats">
|
<div class="stats">
|
||||||
<template v-if="collection.status === 'listed'">
|
<template v-if="collection.status === 'listed'">
|
||||||
<WorldIcon />
|
<WorldIcon />
|
||||||
@@ -638,12 +645,13 @@ export default defineNuxtComponent({
|
|||||||
grid-template-columns: repeat(1, 1fr);
|
grid-template-columns: repeat(1, 1fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
gap: var(--gap-lg);
|
gap: var(--gap-md);
|
||||||
|
|
||||||
.collection-item {
|
.collection-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--gap-md);
|
gap: var(--gap-md);
|
||||||
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.description {
|
.description {
|
||||||
@@ -692,7 +700,7 @@ export default defineNuxtComponent({
|
|||||||
|
|
||||||
.title {
|
.title {
|
||||||
color: var(--color-contrast);
|
color: var(--color-contrast);
|
||||||
font-weight: 600;
|
font-weight: 700;
|
||||||
font-size: var(--font-size-lg);
|
font-size: var(--font-size-lg);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user