Skip to content

Commit

Permalink
feat(megachain): display address in farmers buy form
Browse files Browse the repository at this point in the history
  • Loading branch information
shrpne committed Jul 18, 2023
1 parent 3e4c7da commit f6900c1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions assets/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,15 @@ export const SPOT_DATA = {
METAGARDEN: {
card2CardToken: '_SPOT',
plural: 'Miners',
pluralRu: 'Майнеров',
priceUsd: 320,
minAmount: 0.1,
buyAddress: 'Mxfb758e0516e3ced06eb90387b7fee61ecaad0000',
},
FARMER: {
card2CardToken: '_FARMER',
plural: 'Farmers',
pluralRu: 'Фармеров',
priceUsd: 100,
minAmount: 1,
buyAddress: 'Mx852c9e9befeb187de6968fc7ac75033ba0b0d111',
Expand Down
4 changes: 3 additions & 1 deletion components/ActionMetagardenBuySpot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,12 @@ export default {
@success-modal-close="$emit('success-modal-close')"
>
<template v-slot:default="{fee, estimation}">
<slot name="card-top"/>
<div class="form-row" v-if="isDirectionBuy">
<div class="h-field" :class="{'is-error': $v.spotAmount.$error}">
<div class="h-field__content">
<div class="h-field__title">{{ $td(`${spotData.plural} amount`, 'metagarden.spot-amount-label') }}</div>
<div class="h-field__title">{{ $td(`${spotData.plural} amount`, 'metagarden.spot-amount-label', {spotPlural: spotData.pluralRu}) }}</div>
<InputMaskedAmount
class="h-field__input h-field__input--medium"
placeholder="0"
Expand Down
2 changes: 1 addition & 1 deletion lang/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ export default {
'title': 'Майнеры Metagarden',
// eslint-disable-next-line no-useless-escape
'description': 'Стоимость 1 майнера составляет \${priceUsd} или {priceMetagarden} METAGARDEN. Вы можете купить от 0.1 майнера.',
'spot-amount-label': 'Количество майнеров',
'spot-amount-label': 'Количество {spotPlural}',
'confirm-title': 'Подтвердите покупку',
'mining-spots': 'Майнеры',
'you-own': 'Количество',
Expand Down
14 changes: 12 additions & 2 deletions pages/farming/options/swap.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import {SPOT_DATA} from '~/assets/variables.js';
import FieldAddressDisplay from '~/components/base/FieldAddressDisplay.vue';
import ActionMetagardenBuySpot from '~/components/ActionMetagardenBuySpot.vue';
export const SPOT_PRICE_USD = SPOT_DATA.FARMER.priceUsd;
Expand All @@ -9,6 +10,7 @@ export default {
SPOT_PRICE_USD,
SPOT_MIN_AMOUNT,
components: {
FieldAddressDisplay,
ActionMetagardenBuySpot,
},
data() {
Expand All @@ -32,9 +34,17 @@ export default {

<ActionMetagardenBuySpot
type="FARMER"
class="card card--pop card--light-grey"
class="card card--light-grey"
@success-modal-close="$router.push($i18nGetPreferredPath('/farming'))"
/>
>
<template v-slot:card-top>
<FieldAddressDisplay
class="form-row"
:value="$store.getters.address"
:label="$td('Your Minter address', 'meganet.minter-address-label')"
/>
</template>
</ActionMetagardenBuySpot>


<!-- <div class="card__content card__content&#45;&#45;medium u-text-medium">
Expand Down
1 change: 0 additions & 1 deletion plugins/telegram.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {IS_SUBAPP_MEGAGAMER} from '~/assets/variables.js';

export default ({ app, store }) => {
store.subscribe((mutation) => {
console.log('mutation', mutation.type);
if (mutation.type === 'LOGOUT') {
// remove old data on logout
store.dispatch('telegram/reset');
Expand Down

0 comments on commit f6900c1

Please sign in to comment.