-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from cosmos/peng/74-transactions-page
Create mockup for transactions page
- Loading branch information
Showing
8 changed files
with
124 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template lang="pug"> | ||
page(title='Transactions') | ||
modal-search(v-if="filters.transactions.search.visible" type="transactions") | ||
tool-bar | ||
a(@click='setSearch(true)'): i.material-icons search | ||
|
||
part(title="All Transactions") | ||
card-transaction( | ||
v-for="i in filteredTransactions" | ||
:transaction-value="i") | ||
list-item(v-if='filteredTransactions.length === 0' dt="N/A" dd="None Available") | ||
</template> | ||
|
||
<script> | ||
import { mapGetters } from 'vuex' | ||
import { includes, orderBy } from 'lodash' | ||
import Mousetrap from 'mousetrap' | ||
import AnchorCopy from '../common/AnchorCopy' | ||
import Btn from '@nylira/vue-button' | ||
import ListItem from '../common/NiListItem' | ||
import CardTransaction from './CardTransaction' | ||
import ModalSearch from '../common/ModalSearch' | ||
import Page from '../common/NiPage' | ||
import Part from '../common/NiPart' | ||
import ToolBar from '../common/NiToolBar' | ||
export default { | ||
name: 'page-transactions', | ||
components: { | ||
AnchorCopy, | ||
Btn, | ||
CardTransaction, | ||
ListItem, | ||
ModalSearch, | ||
Page, | ||
Part, | ||
ToolBar | ||
}, | ||
computed: { | ||
...mapGetters(['filters', 'transactions']), | ||
filteredTransactions () { | ||
let query = this.filters.transactions.search.query | ||
let list = orderBy(this.transactions, ['id', 'desc']) | ||
if (this.filters.transactions.search.visible) { | ||
return list.filter(i => includes(i.id.toLowerCase(), query)) | ||
} else { | ||
return list | ||
} | ||
} | ||
}, | ||
methods: { | ||
setSearch (bool) { this.$store.commit('setSearchVisible', ['transactions', bool]) } | ||
}, | ||
mounted () { | ||
Mousetrap.bind(['command+f', 'ctrl+f'], () => this.setSearch(true)) | ||
Mousetrap.bind('esc', () => this.setSearch(false)) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import data from '../json/transactions.json' | ||
|
||
export default ({ commit, basecoin }) => { | ||
const state = data | ||
const mutations = {} | ||
return { state, mutations } | ||
} |