Skip to content

Commit

Permalink
Merge pull request #364 from cosmos/jordan/346-send-button
Browse files Browse the repository at this point in the history
added send button to balances page
  • Loading branch information
nylira authored Jan 15, 2018
2 parents ce031b0 + 8ef7f9e commit 650b912
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 50 deletions.
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

0 comments on commit 650b912

Please sign in to comment.