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

added send button to balances page #364

Merged
merged 4 commits into from
Jan 15, 2018
Merged
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
17 changes: 15 additions & 2 deletions app/src/renderer/components/common/NiListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ transition(name="proposal")
+ni-li-icon

// dt/dd router-link
router-link.ni-li.ni-li-link(v-else-if='dt && to' :to="to"): .ni-li-container
router-link.ni-li.ni-li-link(v-else-if="dt && to && !btn" :to="to"): .ni-li-container
+ni-li-thumb
+ni-li-dl
+ni-li-icon

// button router-link
router-link.ni-li.ni-li-link(v-else-if="btn && to" :to="to"): .ni-li-container
+ni-li-thumb
+ni-li-dl
btn(:value="btn" icon="chevron_right" icon-pos="right").btn__primary

// dt/dd text
.ni-li(v-else-if='dt'): .ni-li-container
+ni-li-thumb
Expand Down Expand Up @@ -57,10 +63,15 @@ transition(name="proposal")
</template>

<script>
import Btn from '@nylira/vue-button'
export default {
name: 'ni-list-item',
props: ['type', 'title', 'subtitle', 'image', 'icon', 'to', 'dt', 'dd', 'href']
props: ['type', 'title', 'subtitle', 'image', 'icon', 'to', 'dt', 'dd', 'href', 'btn'],
components: {
Btn
}
}

</script>

<style lang="stylus">
Expand Down Expand Up @@ -112,6 +123,8 @@ export default {
.ni-li-icon
i.material-icons
color mc
.ni-btn
padding 0 0.75em

.ni-li-container
display flex
Expand Down
1 change: 1 addition & 0 deletions app/src/renderer/components/wallet/PageBalances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ page(title='Balances')
list-item(
v-for="i in filteredBalances"
v-if="wallet.balances.length > 0 && i.amount > 0"
:btn="'Send'"
:key="i.denom"
:dt="i.denom.toUpperCase()"
:dd="i.amount"
Expand Down
116 changes: 68 additions & 48 deletions test/unit/specs/__snapshots__/PageBalances.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,25 @@ exports[`PageBalances has the expected html structure 1`] = `
456
</div>
</div>
<div
class="ni-li-icon"
<button
class="ni-btn btn__primary"
>
<i
class="material-icons inactive"
>
chevron_right
</i>
<i
class="material-icons active"
<span
class="ni-btn-container ni-btn-icon-right"
>
my_location
</i>
</div>
<i
aria-hidden="true"
class="ni-btn-icon material-icons"
>
chevron_right
</i>
<span
class="ni-btn-value"
>
Send
</span>
</span>
</button>
</div>
</a>
<a
Expand Down Expand Up @@ -241,20 +246,25 @@ exports[`PageBalances has the expected html structure 1`] = `
123
</div>
</div>
<div
class="ni-li-icon"
<button
class="ni-btn btn__primary"
>
<i
class="material-icons inactive"
>
chevron_right
</i>
<i
class="material-icons active"
<span
class="ni-btn-container ni-btn-icon-right"
>
my_location
</i>
</div>
<i
aria-hidden="true"
class="ni-btn-icon material-icons"
>
chevron_right
</i>
<span
class="ni-btn-value"
>
Send
</span>
</span>
</button>
</div>
</a>
</main>
Expand Down Expand Up @@ -490,20 +500,25 @@ exports[`PageBalances should filter the balances 1`] = `
456
</div>
</div>
<div
class="ni-li-icon"
<button
class="ni-btn btn__primary"
>
<i
class="material-icons inactive"
>
chevron_right
</i>
<i
class="material-icons active"
<span
class="ni-btn-container ni-btn-icon-right"
>
my_location
</i>
</div>
<i
aria-hidden="true"
class="ni-btn-icon material-icons"
>
chevron_right
</i>
<span
class="ni-btn-value"
>
Send
</span>
</span>
</button>
</div>
</a>
<a
Expand Down Expand Up @@ -532,20 +547,25 @@ exports[`PageBalances should filter the balances 1`] = `
123
</div>
</div>
<div
class="ni-li-icon"
<button
class="ni-btn btn__primary"
>
<i
class="material-icons inactive"
>
chevron_right
</i>
<i
class="material-icons active"
<span
class="ni-btn-container ni-btn-icon-right"
>
my_location
</i>
</div>
<i
aria-hidden="true"
class="ni-btn-icon material-icons"
>
chevron_right
</i>
<span
class="ni-btn-value"
>
Send
</span>
</span>
</button>
</div>
</a>
</main>
Expand Down