From 24c10b8c2724de7cccf87f0ce4458cb6e7d8a976 Mon Sep 17 00:00:00 2001 From: Kyle Welsby Date: Mon, 22 Jul 2024 20:36:19 +0100 Subject: [PATCH] chore: Refactor tracklist pages to use API --- components/Events/EventsListItem.vue | 4 +- components/Home/HomeEvents.vue | 10 +-- components/Home/HomeShows.vue | 2 +- components/Home/HomeSupply.vue | 28 +------ pages/index.vue | 107 ++++++++++----------------- pages/tracklists/page/_page.vue | 1 - 6 files changed, 48 insertions(+), 104 deletions(-) diff --git a/components/Events/EventsListItem.vue b/components/Events/EventsListItem.vue index 34410f5..155aa09 100644 --- a/components/Events/EventsListItem.vue +++ b/components/Events/EventsListItem.vue @@ -18,11 +18,11 @@ ) {{ event.title }} div( class="text-gray-300 truncate mb-2" - ) {{ event.chapters.map((c) => c.title).join(' / ') }} + ) {{ (event.chapters ||[]).map((c) => c.title).join(' / ') }} div( class="text-sm hidden" v-if="!hideDate" - ) {{ event.published_at | formattedDate }} + ) {{ (event.publishedAt || event.pulished_at) | formattedDate }} SiteButton( class="mt-4" :href="href" diff --git a/components/Home/HomeEvents.vue b/components/Home/HomeEvents.vue index 5473be8..afbd184 100644 --- a/components/Home/HomeEvents.vue +++ b/components/Home/HomeEvents.vue @@ -33,9 +33,9 @@ class="mt-4 grid grid-cols-1 md:grid-cols-3 gap-20" ) EventsListItem( - v-for="event of events" + v-for="event of sortedEvents" :event="event" - :key="event.id" + :key="event.slug" ) diff --git a/pages/index.vue b/pages/index.vue index 357f65d..ffc335c 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -4,23 +4,14 @@ ) //- HomeHero HomeRoseGoldAddicted - //- HomeLatest( - //- :post="post" - //- ) - //- HomeSoulectionPlus - //- HomeForgottenGemsTour( - //- :events="forgottenGemsTour" - //- ) + HomeRecords( :latest-album="album" ) - HomeSupply( - :latest-item="supply" - ) + HomeSupply HomeShows( :latest-show="latestShow" ) - //- HomeDecadeOfLegacy HomeEvents( :events="events" ) @@ -29,67 +20,45 @@