Skip to content

Commit 63e2fe3

Browse files
committed
devop: cleanup
1 parent 96900a7 commit 63e2fe3

File tree

4 files changed

+51
-34
lines changed

4 files changed

+51
-34
lines changed

src/components/OrderForm/BuyForm.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
:error-messages="loading.alertMessage"
3030
:disabled="loading.data"
3131
:rules="rules"
32-
></v-text-field>
32+
/>
3333
<v-select
3434
style="max-width: 130px"
3535
class="rounded-right no-left-border buy-input"
@@ -99,6 +99,7 @@
9999
required
100100
variant="outlined"
101101
rounded="left"
102+
readonly
102103
:rules="rules"
103104
:disabled="loading.data"
104105
></v-text-field>
@@ -539,7 +540,6 @@ const networkPrice = computed(() => {
539540
: "0";
540541
});
541542
const networkFeeToFiat = computed(() => {
542-
console.log(networkFeeWei.value, networkPrice.value);
543543
return fromWei(
544544
toBN(networkFeeWei.value).muln(parseFloat(networkPrice.value))
545545
);
@@ -605,17 +605,15 @@ const topperPrice = computed(() => {
605605
});
606606
const topperNetworkFeeText = computed(() => {
607607
return `${form.cryptoSelected} network fee (for transfers to your wallet) ~${
608-
formatFiatValue(0.2, currencyConfig.value).value
608+
formatFiatValue("0.2", currencyConfig.value).value
609609
}`;
610610
});
611611
const topperFiatAmount = computed(() => {
612612
return topperAvailable.value ? form.fiatAmount : "0.00";
613613
});
614614
const topperFiatFee = computed(() => {
615-
const { cryptoAmount } = form;
616615
return topperAvailable.value
617616
? BigNumber(topperFiatAmount.value)
618-
.times(cryptoAmount)
619617
.times(0.029)
620618
.toFixed(fiatCurrency.value.decimals)
621619
: 0;

src/components/OrderForm/BuyProviders.vue

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</v-icon>
88
<div class="mew-heading-2">Select provider</div>
99
</div>
10-
<div class="mew-heading-4">
10+
<div class="mew-heading-2 font-weight-regular pb-2">
1111
Spending <b>{{ topperQuote.plusFeeF }}</b>
1212
</div>
1313
<div v-if="!processingBuy">
@@ -25,16 +25,16 @@
2525
<div class="d-flex mb-1 align-center justify-space-between">
2626
<div
2727
class="d-flex mew-heading-3"
28-
:class="hideMoonpay ? 'text-red' : ''"
28+
:class="disableMoonpay ? 'text-red' : ''"
2929
>
3030
{{ moonpayQuote.cryptoToFiat }}
3131
<div class="d-flex align-center">
3232
<span
3333
class="mew-heading-3 pl-1 mr-1"
34-
:class="hideMoonpay ? 'text-red' : ''"
34+
:class="disableMoonpay ? 'text-red' : ''"
3535
>{{ selectedCryptoName }}</span
3636
>
37-
<v-tooltip v-if="!hideMoonpay" location="bottom">
37+
<v-tooltip v-if="!disableMoonpay" location="bottom">
3838
<template #activator="{ props }">
3939
<v-icon
4040
v-bind="props"
@@ -78,7 +78,7 @@
7878
class="grey-light greyPrimary--text"
7979
width="100%"
8080
variant="flat"
81-
:disabled="hideMoonpay || loading"
81+
:disabled="disableMoonpay || loading"
8282
@click.native="buy"
8383
>{{ moonpayBtnTitle }}</v-btn
8484
>
@@ -91,13 +91,20 @@
9191
<div class="section-block pa-5 mb-6">
9292
<div v-if="!loading" class="mb-3">
9393
<div class="d-flex mb-1 align-center justify-space-between">
94-
<div class="d-flex mew-heading-3">
94+
<div
95+
class="d-flex mew-heading-3"
96+
:class="disableSimplex ? 'text-red' : ''"
97+
>
9598
{{ simplexQuote.cryptoToFiat }}
9699
<div class="d-flex align-center">
97-
<span class="mew-heading-3 pl-1 mr-1">{{
98-
selectedCryptoName
99-
}}</span>
100-
<v-tooltip location="bottom">
100+
<span
101+
:class="[
102+
disableSimplex ? 'text-red' : '',
103+
'mew-heading-3 pl-1 mr-1',
104+
]"
105+
>{{ selectedCryptoName }}</span
106+
>
107+
<v-tooltip location="bottom" v-if="!disableSimplex">
101108
<template #activator="{ props }">
102109
<v-icon
103110
v-bind="props"
@@ -146,7 +153,7 @@
146153
<div class="mew-label mb-5">Visa, Mastercard</div>
147154
<div>
148155
<v-btn
149-
:disabled="loading"
156+
:disabled="loading || disableSimplex"
150157
size="large"
151158
class="grey-light greyPrimary--text"
152159
width="100%"
@@ -162,13 +169,20 @@
162169
<div class="section-block pa-5">
163170
<div v-if="!loading" class="mb-3">
164171
<div class="d-flex mb-1 align-center justify-space-between">
165-
<div class="d-flex mew-heading-3">
172+
<div
173+
class="d-flex mew-heading-3"
174+
:class="disableTopper ? 'text-red' : ''"
175+
>
166176
{{ topperQuote.cryptoToFiat }}
167177
<div class="d-flex align-center">
168-
<span class="mew-heading-3 pl-1 mr-1">{{
169-
selectedCryptoName
170-
}}</span>
171-
<v-tooltip location="bottom">
178+
<span
179+
:class="[
180+
disableTopper ? 'text-red' : '',
181+
'mew-heading-3 pl-1 mr-1',
182+
]"
183+
>{{ selectedCryptoName }}</span
184+
>
185+
<v-tooltip location="bottom" v-if="!disableTopper">
172186
<template #activator="{ props }">
173187
<v-icon
174188
v-bind="props"
@@ -227,7 +241,7 @@
227241
</div>
228242
<div>
229243
<v-btn
230-
:disabled="loading"
244+
:disabled="loading || disableTopper"
231245
size="large"
232246
class="grey-light greyPrimary--text"
233247
width="100%"
@@ -268,6 +282,7 @@ import {
268282
executeTopperPayment,
269283
} from "./order";
270284
import { defineComponent, inject } from "vue";
285+
import BigNumber from "bignumber.js";
271286
272287
export default defineComponent({
273288
name: "BuyProviders",
@@ -336,8 +351,14 @@ export default defineComponent({
336351
isEUR() {
337352
return this.selectedFiatName === "EUR" || this.selectedFiatName === "GBP";
338353
},
339-
hideMoonpay() {
340-
return this.onlySimplex;
354+
disableMoonpay() {
355+
return BigNumber(this.moonpayQuote.cryptoToFiat).isLessThanOrEqualTo(0);
356+
},
357+
disableSimplex() {
358+
return BigNumber(this.simplexQuote.cryptoToFiat).isLessThanOrEqualTo(0);
359+
},
360+
disableTopper() {
361+
return BigNumber(this.topperQuote.cryptoToFiat).isLessThanOrEqualTo(0);
341362
},
342363
simplexBtnTitle() {
343364
return "BUY WITH SIMPLEX";

src/components/OrderForm/components/TokenSelect.vue

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,7 @@ export default defineComponent({
199199
const a = this.tokensList.filter((token) => {
200200
const tokenSymbol = token.name.toLowerCase();
201201
const tokenName = token.subtext.toLowerCase();
202-
if (
203-
this.hasValidPrices(token.symbol) &&
204-
(tokenSymbol.includes(filterText) || tokenName.includes(filterText))
205-
)
202+
if (tokenSymbol.includes(filterText) || tokenName.includes(filterText))
206203
return token;
207204
});
208205
return a;
@@ -212,14 +209,15 @@ export default defineComponent({
212209
},
213210
networkList() {
214211
return this.isSell
215-
? this.networks.filter(
216-
(network) => network.name !== "DOT" && network.name !== "KSM"
217-
)
212+
? this.networks.filter((network) => network.name === "ETH")
218213
: this.networks;
219214
},
220215
filteredNetworkList() {
216+
const withTokensNetwork = this.networkList.filter(
217+
(network) => network.tokens.length > 0
218+
);
221219
const filter = this.networkSearchInput.toLowerCase();
222-
return this.networkList.filter(
220+
return withTokensNetwork.filter(
223221
(network) =>
224222
network.name.toLowerCase().includes(filter) ||
225223
network.name_long.toLowerCase().includes(filter) ||

src/layouts/LandingPage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<div class="background-image pt-15">
77
<v-container>
88
<v-row>
9-
<v-col cols="12" md="5" lg="7">
9+
<v-col cols="12" md="5" lg="6">
1010
<HeaderComponent />
1111
</v-col>
12-
<v-col cols="12" md="7" lg="5">
12+
<v-col cols="12" md="7" lg="6">
1313
<OrderForm />
1414
</v-col>
1515
</v-row>

0 commit comments

Comments
 (0)