2020-10-12 19:41:52 +02:00
|
|
|
<template>
|
|
|
|
<div class="step">
|
2020-10-21 21:45:22 +02:00
|
|
|
<diamond :active="!!data.deployerAddress" />
|
2020-10-12 19:41:52 +02:00
|
|
|
<div class="step-body">
|
|
|
|
<h4>{{ data.title }}</h4>
|
2020-11-05 02:33:56 +01:00
|
|
|
<h6 v-if="data.domain">
|
|
|
|
ENS:
|
|
|
|
<a :href="domainUrl(data.expectedAddress)" target="_blank">{{
|
|
|
|
data.domain
|
|
|
|
}}</a>
|
|
|
|
</h6>
|
2020-11-03 07:54:19 +01:00
|
|
|
<i18n
|
|
|
|
v-if="data.deployerAddress"
|
|
|
|
class="deployed"
|
|
|
|
tag="div"
|
|
|
|
path="deployedBy"
|
|
|
|
>
|
|
|
|
<template v-slot:link>
|
2020-11-05 02:33:56 +01:00
|
|
|
<a :href="txHash(data.deployTransaction)" target="_blank">{{
|
|
|
|
data.deployerAddress
|
|
|
|
}}</a>
|
2020-11-03 07:54:19 +01:00
|
|
|
</template>
|
|
|
|
</i18n>
|
2020-10-12 19:41:52 +02:00
|
|
|
</div>
|
|
|
|
<div class="step-tail">
|
2020-10-21 21:45:22 +02:00
|
|
|
<div v-if="data.deployerAddress" class="completed">
|
2020-10-12 19:41:52 +02:00
|
|
|
<b-icon icon="check" />
|
2020-11-03 07:54:19 +01:00
|
|
|
<span>{{ $t('completed') }}</span>
|
2020-10-12 19:41:52 +02:00
|
|
|
</div>
|
2020-10-21 16:42:50 +02:00
|
|
|
<b-button
|
|
|
|
v-else
|
|
|
|
type="is-primary"
|
|
|
|
outlined
|
|
|
|
icon-left="tool"
|
2020-11-05 02:33:56 +01:00
|
|
|
:disabled="isNotLoggedIn || !canDeploy(data.domain)"
|
2020-11-03 12:48:03 +01:00
|
|
|
@mousedown="(e) => e.preventDefault()"
|
2020-10-21 16:42:50 +02:00
|
|
|
@click="onDeploy"
|
|
|
|
>
|
2020-11-03 07:54:19 +01:00
|
|
|
{{ $t('deploy') }}
|
2020-10-12 19:41:52 +02:00
|
|
|
</b-button>
|
|
|
|
</div>
|
|
|
|
</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'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Diamond,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
data: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
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']),
|
|
|
|
// todo pass ens domain here
|
|
|
|
onDeploy(/* domain */) {
|
2020-10-30 09:01:41 +01:00
|
|
|
// console.log('this.props', this.data)
|
2020-11-05 02:33:56 +01:00
|
|
|
this.deployContract({ action: this.data })
|
|
|
|
},
|
|
|
|
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>
|