Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign for history/invoices/mints layout... #188

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/BalanceView.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<!-- <q-card class="q-my-md q-py-sm">
<q-card-section class="q-mt-sm q-py-xs"> -->
<div class="q-pt-xl q-pb-md">
<div class="q-pt-md q-pb-md">
<div class="row justify-center q-pb-lg">
<ToggleUnit class="q-mt-lg q-mb-none" />
</div>
Expand All @@ -19,7 +19,7 @@
animated
:height="$q.screen.width < 390 ? '130px' : '80px'"
control-color="primary"
class="bg-transparent rounded-borders q-mb-xl q-mt-xl text-primary"
class="bg-transparent rounded-borders q-mb-md q-mt-md text-primary"
>
<!-- make a q-carousel-slide with v-for for all possible units -->
<q-carousel-slide
Expand Down
16 changes: 1 addition & 15 deletions src/components/HistoryTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@
<div v-if="paginatedTokens.length === 0" class="text-center q-mt-lg">
<q-item-label caption class="text-primary">No history yet</q-item-label>
</div>
<div v-else-if="maxPages > 1" class="text-center q-mt-lg">
<div style="display: flex; justify-content: center">
<q-pagination
v-model="currentPage"
:max="maxPages"
:max-pages="5"
direction-links
boundary-links
@input="handlePageChange"
/>
</div>
</div>
</div>
</template>
<script>
Expand Down Expand Up @@ -119,9 +107,7 @@ export default defineComponent({
return Math.ceil(this.historyTokens.length / this.pageSize);
},
paginatedTokens() {
const start = (this.currentPage - 1) * this.pageSize;
const end = start + this.pageSize;
return this.historyTokens.slice().reverse().slice(start, end);
return this.historyTokens.slice().reverse()
},
},
methods: {
Expand Down
16 changes: 1 addition & 15 deletions src/components/InvoicesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@
>No invoices yet</q-item-label
>
</div>
<div v-else-if="maxPages > 1" class="text-center q-mt-lg">
<div style="display: flex; justify-content: center">
<q-pagination
v-model="currentPage"
:max="maxPages"
:max-pages="5"
direction-links
boundary-links
@input="handlePageChange"
/>
</div>
</div>
</div>
</div>
</template>
Expand Down Expand Up @@ -104,9 +92,7 @@ export default defineComponent({
return Math.ceil(this.invoiceHistory.length / this.pageSize);
},
paginatedInvoices() {
const start = (this.currentPage - 1) * this.pageSize;
const end = start + this.pageSize;
return this.invoiceHistory.slice().reverse().slice(start, end);
return this.invoiceHistory.slice().reverse()
},
},
methods: {
Expand Down
110 changes: 61 additions & 49 deletions src/pages/WalletPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,55 +52,63 @@
<!-- ///////////////////////////////////////////
////////////////// TABLES /////////////////
/////////////////////////////////////////// -->
<q-expansion-item expand-icon-class="hidden" v-model="expandHistory">
<template v-slot:header="{ expanded }">
<q-item-section class="item-center text-center">
<span
><q-icon
color="primary"
:name="expanded ? 'keyboard_arrow_up' : 'keyboard_arrow_down'"
/></span>
</q-item-section>
</template>
<q-tabs
v-model="tab"
no-caps
:class="$q.dark.isActive ? 'bg-dark' : 'bg-white'"
>
<q-tab name="history" class="text-secondary" label="History"></q-tab>
<q-tab
name="invoices"
class="text-secondary"
label="Invoices"
></q-tab>
<!-- <q-tab name="tokens" label="Tokens"></q-tab> -->
<q-tab name="mints" class="text-secondary" label="Mints"></q-tab>
</q-tabs>

<q-tab-panels
:class="$q.dark.isActive ? 'bg-dark' : 'bg-white'"
v-model="tab"
animated
>
<!-- ////////////////// HISTORY LIST ///////////////// -->

<q-tab-panel name="history">
<HistoryTable :show-token-dialog="showTokenDialog" />
</q-tab-panel>

<!-- ////////////////// INVOICE LIST ///////////////// -->

<q-tab-panel name="invoices">
<InvoicesTable />
</q-tab-panel>

<!-- ////////////////////// SETTINGS ////////////////// -->

<q-tab-panel name="mints" class="q-px-sm">
<MintSettings />
</q-tab-panel>
</q-tab-panels>
</q-expansion-item>

<div class="flex justify-center absolute-bottom" style="bottom: 15px;">
<q-btn flat no-caps label="History" class="q-mx-md text-secondary" @click="viewTab('history')"/>
<q-btn flat no-caps label="Invoices" class="q-mx-md text-secondary" @click="viewTab('invoices')"/>
<q-btn flat no-caps label="Mints" class="q-mx-md text-secondary" @click="viewTab('mints')"/>
</div>

<q-dialog v-model="expandHistory" seamless :persistent="false" position="bottom">
<q-card style="min-width: 80vw;" bordered>
<div
class="flex justify-center"
:class="$q.dark.isActive ? 'bg-dark' : 'bg-white'"
>
<q-btn flat round icon="expand_more" v-close-popup />
</div>
<q-tabs
v-model="tab"
no-caps
:class="$q.dark.isActive ? 'bg-dark' : 'bg-white'"
>
<q-tab name="history" class="text-secondary" label="History"></q-tab>
<q-tab
name="invoices"
class="text-secondary"
label="Invoices"
></q-tab>
<!-- <q-tab name="tokens" label="Tokens"></q-tab> -->
<q-tab name="mints" class="text-secondary" label="Mints"></q-tab>
</q-tabs>

<div style="height: 50vh" class="scroll" :class="$q.dark.isActive ? 'bg-dark' : 'bg-white'">
<q-tab-panels
:class="$q.dark.isActive ? 'bg-dark' : 'bg-white'"
v-model="tab"
animated
>
<!-- ////////////////// HISTORY LIST ///////////////// -->

<q-tab-panel name="history">
<HistoryTable :show-token-dialog="showTokenDialog" />
</q-tab-panel>

<!-- ////////////////// INVOICE LIST ///////////////// -->

<q-tab-panel name="invoices">
<InvoicesTable />
</q-tab-panel>

<!-- ////////////////////// SETTINGS ////////////////// -->

<q-tab-panel name="mints" class="q-px-sm">
<MintSettings />
</q-tab-panel>
</q-tab-panels>
</div>
</q-card>
</q-dialog>

<div style="margin-bottom: 0rem">
<div class="row q-pt-sm">
Expand Down Expand Up @@ -354,6 +362,10 @@ export default {
]),
...mapActions(useCameraStore, ["closeCamera", "showCamera"]),
...mapActions(useNWCStore, ["listenToNWCCommands"]),
viewTab(tab) {
this.expandHistory = true
this.tab = tab
},
// TOKEN METHODS
decodeToken: function (encoded_token) {
try {
Expand Down
Loading