Skip to content

Commit

Permalink
refactor(Dashboard): fix Proof count. Cleanup Price & Proof headers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Oct 1, 2024
1 parent 02199aa commit fe0c712
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 31 deletions.
22 changes: 5 additions & 17 deletions src/views/UserDashboardPriceList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,15 @@
{{ $t('UserDashboard.MyPrices') }}
</h1>

<v-row>
<v-row v-if="!loading">
<v-col>
<v-chip class="mr-2" label variant="text" prepend-icon="mdi-tag-multiple-outline">
<v-chip label variant="text" prepend-icon="mdi-tag-multiple-outline">
{{ $t('UserDashboard.UserPriceTotal', { count: userPriceTotal }) }}
</v-chip>
<v-btn size="small" prepend-icon="mdi-arrow-left" to="/dashboard">
<LoadedCountChip v-if="!loading" :loadedCount="userPriceList.length" :totalCount="userPriceTotal" />
<v-btn size="x-small" prepend-icon="mdi-arrow-left" to="/dashboard">
{{ $t('UserDashboard.Title') }}
</v-btn>
<ShareLink :overrideUrl="getShareLinkUrl" display="button" />
</v-col>
</v-row>

<v-row>
<v-col>
<h2 class="text-h6 d-inline mr-1">
{{ $t('Common.LatestPrices') }}
</h2>
<LoadedCountChip v-if="!loading" :loadedCount="userPriceList.length" :totalCount="userPriceTotal" />
</v-col>
</v-row>

Expand All @@ -46,12 +37,12 @@ import utils from '../utils.js'
export default {
components: {
ShareLink: defineAsyncComponent(() => import('../components/ShareLink.vue')),
LoadedCountChip: defineAsyncComponent(() => import('../components/LoadedCountChip.vue')),
PriceCard: defineAsyncComponent(() => import('../components/PriceCard.vue'))
},
data() {
return {
// data
userPriceList: [],
userPriceTotal: null,
userPricePage: 0,
Expand All @@ -62,9 +53,6 @@ export default {
...mapStores(useAppStore),
username() {
return this.appStore.user.username
},
getShareLinkUrl() {
return `/users/${this.username}`
}
},
mounted() {
Expand Down
21 changes: 7 additions & 14 deletions src/views/UserDashboardProofList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,17 @@
{{ $t('UserDashboard.MyProofs') }}
</h1>

<v-row>
<v-col>
<v-chip class="mr-2" label variant="text" prepend-icon="mdi-image">
{{ $t('UserDashboard.UserProofTotal', { count: appStore.getUserProofTotal }) }}
</v-chip>
<v-btn size="small" prepend-icon="mdi-arrow-left" to="/dashboard">
{{ $t('UserDashboard.Title') }}
</v-btn>
</v-col>
</v-row>

<v-row v-if="!loading">
<v-col>
<h2 class="text-h6 d-inline mr-1">
{{ $t('Common.LatestProofs') }}
</h2>
<v-chip label variant="text" prepend-icon="mdi-image">
{{ $t('UserDashboard.UserProofTotal', { count: userProofTotal }) }}
</v-chip>
<LoadedCountChip :loadedCount="userProofList.length" :totalCount="userProofTotal" />
<FilterMenu kind="proof" :currentFilter="currentFilter" @update:currentFilter="toggleProofFilter($event)" />
<OrderMenu kind="proof" :currentOrder="currentOrder" @update:currentOrder="selectProofOrder($event)" />
<v-btn size="x-small" prepend-icon="mdi-arrow-left" to="/dashboard">
{{ $t('UserDashboard.Title') }}
</v-btn>
</v-col>
</v-row>

Expand Down Expand Up @@ -63,6 +55,7 @@ export default {
},
data() {
return {
// data
userProofList: [],
userProofTotal: null,
userProofPage: 0,
Expand Down

0 comments on commit fe0c712

Please sign in to comment.