From 32b961dd325bf27eb6f301ec8c6158859522e957 Mon Sep 17 00:00:00 2001 From: Blossomi Shymae <87099578+BlossomiShymae@users.noreply.github.com> Date: Wed, 1 May 2024 21:56:30 -0500 Subject: [PATCH] Add champions feat --- components/Pagination.vue | 45 ++++++++++--------- composables/usePagination.ts | 32 +++++++++++++ core/client.ts | 13 +++++- layouts/default.vue | 6 +-- pages/champions/index.vue | 44 ++++++++++++++++++ pages/champions/overview/[id].vue | 62 ++++++++++++++++++++++++++ pages/summoner-icons/index.vue | 16 ++++--- pages/summoner-icons/overview/[id].vue | 32 +++++++++++++ utils/paginated-array.ts | 50 --------------------- 9 files changed, 217 insertions(+), 83 deletions(-) create mode 100644 composables/usePagination.ts create mode 100644 pages/champions/index.vue create mode 100644 pages/champions/overview/[id].vue create mode 100644 pages/summoner-icons/overview/[id].vue delete mode 100644 utils/paginated-array.ts diff --git a/components/Pagination.vue b/components/Pagination.vue index 664aad9..7262f8e 100644 --- a/components/Pagination.vue +++ b/components/Pagination.vue @@ -1,20 +1,24 @@ @@ -22,18 +26,17 @@ import MaterialIcon from './MaterialIcon.vue'; const props = defineProps<{ - hasPrevious: boolean; - hasFurtherPrevious: boolean; - hasNext: boolean; - hasFurtherNext: boolean; - pageIndex: number; - totalPages: number; + index: number, + pages: Array, + count: number, + onPrev: () => void, + onNext: () => void, + onFirst: () => void, + onLast: () => void, }>(); -const hasPreviousCss = !props.hasPrevious ? "disabled" : ""; -const hasFurtherPreviousCss = !props.hasFurtherPrevious ? "disabled" : ""; -const hasNextCss = !props.hasNext ? "disabled" : ""; -const hasFurtherNextCss = !props.hasFurtherNext ? "disabled" : ""; +const hasPrevCss = computed(() => { return !(props.index > 0) ? "disabled" : ""; }); +const hasNextCss = computed(() => { return !(props.index < props.count - 1) ? "disabled" : "";})