2020-10-12 19:41:52 +02:00
|
|
|
<template>
|
|
|
|
<div class="step">
|
2020-11-05 14:54:14 +01:00
|
|
|
<div class="step-container">
|
|
|
|
<diamond
|
|
|
|
:active="!!data.deployerAddress"
|
|
|
|
:waiting="!canDeploy(data.domain)"
|
|
|
|
/>
|
|
|
|
<div class="step-body">
|
|
|
|
<h4>{{ data.title }}</h4>
|
|
|
|
<h5 v-if="data.domain" class="deployed">
|
|
|
|
ENS:
|
|
|
|
<a :href="domainUrl(data.expectedAddress)" target="_blank">{{
|
|
|
|
data.domain
|
2020-11-05 02:33:56 +01:00
|
|
|
}}</a>
|
2020-11-05 14:54:14 +01:00
|
|
|
</h5>
|
|
|
|
<i18n
|
|
|
|
v-if="data.deployerAddress"
|
|
|
|
class="deployed"
|
|
|
|
tag="h6"
|
|
|
|
path="deployedBy"
|
|
|
|
>
|
|
|
|
<template v-slot:link>
|
|
|
|
<a :href="txHash(data.deployTransaction)" target="_blank">{{
|
|
|
|
data.deployerAddress
|
|
|
|
}}</a>
|
|
|
|
</template>
|
|
|
|
</i18n>
|
|
|
|
</div>
|
|
|
|
<div class="step-more-button">
|
|
|
|
<b-button size="is-small" @click="isExpanded = !isExpanded">{{
|
|
|
|
isExpanded ? 'Less' : 'More'
|
|
|
|
}}</b-button>
|
2020-10-12 19:41:52 +02:00
|
|
|
</div>
|
2020-11-05 14:54:14 +01:00
|
|
|
<div class="step-tail">
|
|
|
|
<div v-if="data.deployerAddress" class="completed">
|
|
|
|
<b-icon icon="check" />
|
|
|
|
<span>{{ $t('completed') }}</span>
|
|
|
|
</div>
|
|
|
|
<b-tooltip
|
|
|
|
v-else
|
|
|
|
:label="
|
|
|
|
isNotLoggedIn
|
|
|
|
? $t('pleaseConnectWallet')
|
|
|
|
: !canDeploy(data.domain)
|
|
|
|
? $t('dependsOnEns', { ens: data.dependsOn.join(', ') })
|
|
|
|
: ''
|
|
|
|
"
|
|
|
|
position="is-top"
|
|
|
|
multilined
|
|
|
|
:size="isNotLoggedIn ? 'is-small' : 'is-large'"
|
|
|
|
:active="isNotLoggedIn || !canDeploy(data.domain)"
|
2020-11-05 08:47:03 +01:00
|
|
|
>
|
2020-11-05 14:54:14 +01:00
|
|
|
<b-button
|
|
|
|
type="is-primary"
|
|
|
|
outlined
|
|
|
|
icon-left="tool"
|
2020-11-19 11:25:44 +01:00
|
|
|
:disabled="
|
|
|
|
isNotLoggedIn || !canDeploy(data.domain) || data.isPending
|
|
|
|
"
|
2020-11-05 14:54:14 +01:00
|
|
|
@mousedown="(e) => e.preventDefault()"
|
|
|
|
@click="onDeploy"
|
|
|
|
>
|
|
|
|
{{ $t('deploy') }}
|
|
|
|
</b-button>
|
|
|
|
</b-tooltip>
|
|
|
|
</div>
|
2020-10-12 19:41:52 +02:00
|
|
|
</div>
|
2020-11-05 14:54:14 +01:00
|
|
|
<transition-expand>
|
|
|
|
<div v-show="isExpanded" class="step-more">
|
|
|
|
<p>{{ data.description }}</p>
|
|
|
|
</div>
|
|
|
|
</transition-expand>
|
2020-10-12 19:41:52 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-11-03 12:48:03 +01:00
|
|
|
import { mapGetters, mapActions } from 'vuex'
|
2020-10-12 19:41:52 +02:00
|
|
|
import Diamond from '@/components/Diamond'
|
2020-11-05 14:54:14 +01:00
|
|
|
import TransitionExpand from '@/components/TransitionExpand'
|
2020-10-12 19:41:52 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Diamond,
|
2020-11-05 14:54:14 +01:00
|
|
|
TransitionExpand,
|
2020-10-12 19:41:52 +02:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
data: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2020-11-05 14:54:14 +01:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
isExpanded: false,
|
|
|
|
}
|
|
|
|
},
|
2020-11-03 12:48:03 +01:00
|
|
|
computed: {
|
|
|
|
...mapGetters('provider', ['getProviderName']),
|
2020-11-05 02:33:56 +01:00
|
|
|
...mapGetters('steps', ['canDeploy']),
|
2020-11-03 12:48:03 +01:00
|
|
|
isNotLoggedIn() {
|
|
|
|
return !this.getProviderName
|
|
|
|
},
|
|
|
|
},
|
2020-10-21 16:42:50 +02:00
|
|
|
methods: {
|
|
|
|
...mapActions('deploy', ['deployContract']),
|
2020-11-19 11:25:44 +01:00
|
|
|
onDeploy() {
|
|
|
|
this.deployContract({ action: this.data, index: this.$vnode.key })
|
2020-11-05 02:33:56 +01:00
|
|
|
},
|
|
|
|
domainUrl(address) {
|
|
|
|
return `https://etherscan.io/address/${address}`
|
|
|
|
},
|
|
|
|
txHash(txHash) {
|
|
|
|
return `https://etherscan.io/tx/${txHash}`
|
2020-10-21 16:42:50 +02:00
|
|
|
},
|
|
|
|
},
|
2020-10-12 19:41:52 +02:00
|
|
|
}
|
|
|
|
</script>
|