Skip to content

Commit

Permalink
feat(proof card): display date & currency in the footer (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Jun 20, 2024
1 parent cd2be26 commit 25b7b82
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/CurrencyChip.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<v-chip label size="small" density="comfortable">
<v-icon start icon="mdi-cash" />
{{ proof.currency }}
</v-chip>
</template>

<script>
export default {
props: {
proof: {
type: Object,
default: null
},
},
}
</script>
24 changes: 24 additions & 0 deletions src/components/ProofDateChip.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<v-chip label size="small" density="comfortable">
<v-icon start icon="mdi-camera" />
{{ getDateFormatted(proof.date) }}
</v-chip>
</template>

<script>
import utils from '../utils.js'
export default {
props: {
proof: {
type: Object,
default: null
},
},
methods: {
getDateFormatted(dateString) {
return utils.prettyDate(dateString)
},
}
}
</script>
4 changes: 4 additions & 0 deletions src/components/ProofFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<v-col :cols="userIsProofOwner ? '11' : '12'">
<ProofTypeChip class="mr-1" :proof="proof" />
<ProofPrivateChip v-if="proofIsPrivateReceipt" class="mr-1" :proof="proof" />
<ProofDateChip v-if="proof.date" class="mr-1" :proof="proof" />
<PriceCountChip :count="proof.price_count" :withLabel="true" @click="goToProof()" />
<CurrencyChip v-if="proof.currency" class="mr-1" :proof="proof" />
<RelativeDateTimeChip :dateTime="proof.created" />
</v-col>
</v-row>
Expand All @@ -21,6 +23,8 @@ export default {
ProofTypeChip: defineAsyncComponent(() => import('../components/ProofTypeChip.vue')),
ProofPrivateChip: defineAsyncComponent(() => import('../components/ProofPrivateChip.vue')),
PriceCountChip: defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
ProofDateChip: defineAsyncComponent(() => import('../components/ProofDateChip.vue')),
CurrencyChip: defineAsyncComponent(() => import('../components/CurrencyChip.vue')),
RelativeDateTimeChip: defineAsyncComponent(() => import('../components/RelativeDateTimeChip.vue')),
ProofActionMenuButton: defineAsyncComponent(() => import('../components/ProofActionMenuButton.vue'))
},
Expand Down

0 comments on commit 25b7b82

Please sign in to comment.