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

Improve the Send page #156

Merged
merged 2 commits into from
Dec 4, 2017
Merged
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
45 changes: 15 additions & 30 deletions app/src/renderer/components/wallet/PageSend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
page(title='Send Tokens')
div(slot="menu"): tool-bar

form-struct(:submit='onSubmit')
form-struct(:submit="onSubmit")
form-group(:error='$v.fields.denom.$error'
field-id='send-denomination' field-label='Denomination')
field#send-denomination(
type="select"
v-model="fields.denom"
:options="denominations"
@input="$v.fields.denom.$touch()"
placeholder="Select token...")
form-msg(name='Denomination' type='required' v-if='!$v.fields.denom.required')

Expand All @@ -19,7 +18,6 @@ page(title='Send Tokens')
field#send-address(
type='text'
v-model='fields.address'
@input='$v.fields.address.$touch()'
placeholder='Address')
form-msg(name='Address' type='required' v-if='!$v.fields.address.required')
form-msg(name='Address' type='exactLength' length='40'
Expand All @@ -32,7 +30,6 @@ page(title='Send Tokens')
field#send-amount(
type='number'
v-model='fields.amount'
@input='$v.fields.amount.$touch()'
placeholder='Amount')
field-addon Coins
btn(value='Max')
Expand All @@ -41,7 +38,6 @@ page(title='Send Tokens')
v-if='!$v.fields.amount.between')

div(slot='footer')
// btn(value='Reset' @click.native='resetForm')
div
btn(v-if='sending' value='Sending...' disabled)
btn(v-else @click='onSubmit' icon="check" value="Send Tokens")
Expand All @@ -52,13 +48,13 @@ import { required, between, minLength, maxLength, alphaNum } from 'vuelidate/lib
import { mapActions, mapGetters } from 'vuex'
import Btn from '@nylira/vue-button'
import Field from '@nylira/vue-field'
import FieldAddon from '../common/NiFieldAddon'
import FieldGroup from '../common/NiFieldGroup'
import FormGroup from '../common/NiFormGroup'
import FieldAddon from 'common/NiFieldAddon'
import FieldGroup from 'common/NiFieldGroup'
import FormGroup from 'common/NiFormGroup'
import FormMsg from '@nylira/vue-form-msg'
import FormStruct from '../common/NiFormStruct'
import Page from '../common/NiPage'
import ToolBar from '../common/NiToolBar'
import FormStruct from 'common/NiFormStruct'
import Page from 'common/NiPage'
import ToolBar from 'common/NiToolBar'
export default {
components: {
Btn,
Expand All @@ -78,6 +74,14 @@ export default {
({ key: i.denom.toUpperCase(), value: i.denom }))
}
},
data: () => ({
fields: {
address: '',
amount: null,
denom: ''
},
sending: false
}),
methods: {
resetForm () {
this.fields.address = ''
Expand Down Expand Up @@ -115,14 +119,6 @@ export default {
},
...mapActions(['walletSend'])
},
data: () => ({
fields: {
address: '',
amount: null,
denom: ''
},
sending: false
}),
validations: () => ({
fields: {
address: {
Expand All @@ -142,14 +138,3 @@ export default {
})
}
</script>

<style lang="stylus">
@require '~variables'

#send-address
#send-amount
mono()
&:placeholder
df()
color dim
</style>