Skip to content

Commit

Permalink
FieldFee: add loader
Browse files Browse the repository at this point in the history
  • Loading branch information
shrpne committed Apr 14, 2022
1 parent 9aa42d3 commit d2953de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions components/common/FieldCoin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import checkEmpty from '~/assets/v-check-empty';
import {pretty} from '~/assets/utils.js';
import {COIN_TYPE} from '~/assets/variables.js';
import Loader from '~/components/common/Loader.vue';
import InputUppercase from '~/components/common/InputUppercase';
const MAX_ITEM_COUNT = 6;
Expand All @@ -12,6 +13,7 @@
MAX_ITEM_COUNT,
components: {
VueSimpleSuggest,
Loader,
InputUppercase,
},
directives: {
Expand Down Expand Up @@ -48,6 +50,10 @@
type: Boolean,
default: false,
},
isLoading: {
type: Boolean,
default: false,
},
},
data() {
return {
Expand Down Expand Up @@ -204,5 +210,6 @@
<span v-if="getSuggestionAmount(suggestion)">{{ getSuggestionAmount(suggestion) }}</span>
</div>
</VueSimpleSuggest>
<Loader class="form-field__icon form-field__icon--loader" :isLoading="isLoading"/>
</label>
</template>
4 changes: 3 additions & 1 deletion components/common/FieldFee.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default {
type: Array,
default: () => [],
},
/** @type {Array<FeeData>} */
fee: {
type: Object,
required: true,
Expand Down Expand Up @@ -73,14 +74,15 @@ export default {
:label="label"
:coin-list="gasSuitableBalance"
:select-mode="true"
:is-loading="fee.isLoading"
/>
<span class="form-field__error" v-if="$value.$dirty && $value.minLength === false">{{ $td('Min 3 letters', 'form.coin-error-min') }}</span>
<!--<span class="form-field__error" v-else-if="$value.$dirty && !$value.maxLength">{{ $td('Max 10 letters', 'form.coin-error-max') }}</span>-->
<span class="form-field__error" v-else-if="$value.$dirty && $value.fee === false">{{ fee.error }}</span>
<div class="form-field__help" v-else-if="$store.getters.isOfflineMode">{{ $td(`Equivalent of ${$store.getters.COIN_NAME} ${pretty(fee.baseCoinValue)}`, 'form.fee-help', {value: pretty(fee.baseCoinValue), coin: $store.getters.COIN_NAME}) }}</div>
<div class="form-field__help" v-else>
{{ pretty(fee.value) }} {{ fee.coinSymbol }}
<span class="u-display-ib" v-if="!fee.isBaseCoin">({{ pretty(fee.baseCoinValue) }} {{ $store.getters.COIN_NAME }})</span>
<span class="u-display-ib" v-if="!fee.isBaseCoin && fee.baseCoinValue">({{ pretty(fee.baseCoinValue) }} {{ $store.getters.COIN_NAME }})</span>
</div>
</div>
</template>

0 comments on commit d2953de

Please sign in to comment.