From 368bab25534a26cfda2b7b7ce266425b5d3b7406 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Thu, 13 May 2021 12:05:24 +0530 Subject: [PATCH] chore: Refactor contact page button with button component (#2234) * chore: Refactor contact page buttons with woot-button component Co-authored-by: Nithin David Thomas --- .../components/widgets/TableFooter.vue | 54 +++++++------------ .../dashboard/contacts/components/Header.vue | 20 ++++--- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/TableFooter.vue b/app/javascript/dashboard/components/widgets/TableFooter.vue index b4123f433..c951aad60 100644 --- a/app/javascript/dashboard/components/widgets/TableFooter.vue +++ b/app/javascript/dashboard/components/widgets/TableFooter.vue @@ -12,39 +12,41 @@ v-if="totalCount" class="primary button-group pagination-button-group" > - - - - - + @@ -91,35 +93,19 @@ export default { this.currentPage === Math.ceil(this.totalCount / this.pageSize); return isDisabled; }, - lastPageButtonClass() { - const className = this.hasLastPage ? 'disabled' : ''; - return className; - }, hasFirstPage() { const isDisabled = this.currentPage === 1; return isDisabled; }, - firstPageButtonClass() { - const className = this.hasFirstPage ? 'disabled' : ''; - return className; - }, hasNextPage() { const isDisabled = this.currentPage === Math.ceil(this.totalCount / this.pageSize); return isDisabled; }, - nextPageButtonClass() { - const className = this.hasNextPage ? 'disabled' : ''; - return className; - }, hasPrevPage() { const isDisabled = this.currentPage === 1; return isDisabled; }, - prevPageButtonClass() { - const className = this.hasPrevPage ? 'disabled' : ''; - return className; - }, }, methods: { onNextPage() { diff --git a/app/javascript/dashboard/routes/dashboard/contacts/components/Header.vue b/app/javascript/dashboard/routes/dashboard/contacts/components/Header.vue index 2c6b2d63b..f96e75077 100644 --- a/app/javascript/dashboard/routes/dashboard/contacts/components/Header.vue +++ b/app/javascript/dashboard/routes/dashboard/contacts/components/Header.vue @@ -17,18 +17,22 @@ @keyup.enter="onSearchSubmit" @input="onInputSearch" /> - + > + {{ $t('CONTACTS_PAGE.SEARCH_BUTTON') }} + - +