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

Ana/emoney sendmodal multiple denoms #3370

Merged
merged 21 commits into from
Jan 14, 2020
Merged
Changes from 3 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
62 changes: 37 additions & 25 deletions src/ActionModal/components/SendModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
v-model.number="$v.address.$model"
v-focus
type="text"
placeholder="Address"
placeholder="Address..."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what Charlie's flow showed 😆

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. sorry about that. let's remove it for now since it would be inconsistent with all our forms.

@keyup.enter.native="refocusOnAmount"
/>
<TmFormMsg
Expand All @@ -38,6 +38,28 @@
/>
</TmFormGroup>
<TmFormGroup
v-if="getDenoms.length > 1"
:error="$v.selectedToken.$error"
class="action-modal-form-group"
field-id="selected-token"
field-label="Token"
>
<TmField
id="token"
v-model="selectedToken"
:title="`Select the token you wish to operate with`"
:options="getDenoms"
placeholder="Select the token"
type="select"
/>
<TmFormMsg
v-if="$v.selectedToken.$error && !$v.selectedToken.required"
name="Token"
type="required"
/>
</TmFormGroup>
<TmFormGroup
id="form-group-amount"
:error="$v.amount.$error && $v.amount.$invalid"
class="action-modal-form-group"
field-id="amount"
Expand Down Expand Up @@ -93,27 +115,6 @@
class="tm-form-msg--desc max-message"
/>
</TmFormGroup>
<TmFormGroup
v-if="getDenoms.length > 1"
:error="$v.selectedToken.$error"
class="action-modal-form-group"
field-id="selected-token"
field-label="Token"
>
<TmField
id="token"
v-model="selectedToken"
:title="`Select the token you wish to operate with`"
:options="getDenoms"
placeholder="Select the token"
type="select"
/>
<TmFormMsg
v-if="$v.selectedToken.$error && !$v.selectedToken.required"
name="Token"
type="required"
/>
</TmFormGroup>
<a v-if="editMemo === false" id="edit-memo-btn" @click="showMemo()">
Need to edit the memo field?
</a>
Expand Down Expand Up @@ -183,6 +184,7 @@ export default {
memo: defaultMemo,
max_memo_characters: 256,
editMemo: false,
isFirstLoad: true,
selectedToken: ``,
selectedBalance: ``,
balances: [
Expand Down Expand Up @@ -222,6 +224,17 @@ export default {
return this.denoms.map(denom => (denom = { key: denom, value: denom }))
}
},
watch: {
// we set the amount in the input to zero every time the user selects another token so they
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

// realize they are dealing with a different balance each time
selectedToken: function() {
if (!this.isFirstLoad) {
this.amount = 0
} else {
this.isFirstLoad = false
}
}
},
mounted() {
this.$apollo.queries.balance.refetch()
},
Expand Down Expand Up @@ -364,8 +377,7 @@ export default {
cursor: pointer;
}

#token {
width: 155px;
margin-bottom: 10px;
#form-group-amount {
margin-bottom: 30px;
}
</style>