Skip to content

Commit

Permalink
Activity filter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mpwanyi256 committed Nov 30, 2022
1 parent 8ef81e3 commit a875421
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
9 changes: 7 additions & 2 deletions src/components/ActivityFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{ $t('components.activityFilter.dateRange') }}
</div>
<div class="date-filter-inputs h-padding form">
<date-pick v-model="dateFilters.start">
<date-pick v-model="dateFilters.start" @input="changeTrigered">
<template v-slot:default="{ toggle, inputValue, inputEvents }">
<div class="input-group" @click="toggle">
<input
Expand All @@ -37,7 +37,7 @@
</div>
</template>
</date-pick>
<date-pick v-model="dateFilters.end">
<date-pick v-model="dateFilters.end" @input="changeTrigered">
<template v-slot:default="{ toggle, inputValue, inputEvents }">
<div class="input-group" @click="toggle">
<input
Expand Down Expand Up @@ -261,6 +261,11 @@ export default {
statuses,
dates: this.dateFilters
})
},
changeTrigered() {
this.$nextTick(() => {
this.applyFilters()
})
}
}
}
Expand Down
27 changes: 27 additions & 0 deletions src/components/NoTransactionsFound.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div class="empty-state">
<p>{{ message || 'Sorry, no results found' }}</p>
</div>
</template>
<script>
export default {
name: 'NoTransactionsFound',
props: ['message']
}
</script>
<style scoped lang="scss">
.empty-state {
min-height: 300px;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
p {
font-size: 1rem;
margin: 0;
}
}
</style>
9 changes: 7 additions & 2 deletions src/components/TransactionList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<div class="transaction-list">
<NoTransactionsFound v-if="!transactions.length" />
<ListItem
v-else
v-for="item in transactions"
:key="item.id"
:id="item.type + '_' + item.from + '_' + item.to"
Expand Down Expand Up @@ -39,6 +41,8 @@
<script>
import ListItem from '@/components/ListItem'
import TransactionStatus from '@/components/TransactionStatus'
import NoTransactionsFound from '@/components/NoTransactionsFound.vue'
import {
getStep,
ACTIVITY_STATUSES,
Expand All @@ -58,7 +62,8 @@ import { mapState } from 'vuex'
export default {
components: {
ListItem,
TransactionStatus
TransactionStatus,
NoTransactionsFound
},
props: ['transactions'],
computed: {
Expand Down Expand Up @@ -156,4 +161,4 @@ export default {
}
</script>
<style lang="scss"></style>
<style lang="sss"></style>
6 changes: 3 additions & 3 deletions src/views/Wallet/WalletActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<ActivityFilter
@filters-changed="applyFilters"
:activity-data="activityData"
v-if="activityData.length > 0"
v-if="activity.length"
:showTypeFilters="true"
/>
<TransactionList :transactions="activityData" />
<EmptyActivity v-show="activityData.length <= 0" :active-network="activeNetwork" />
<TransactionList v-if="activity.length" :transactions="activityData" />
<EmptyActivity v-else :active-network="activeNetwork" />
</div>
</template>

Expand Down

0 comments on commit a875421

Please sign in to comment.