add copy contribution hash button

This commit is contained in:
Danil Kovtonyuk 2020-02-29 22:47:04 +10:00
parent a94a337363
commit 53ddd3464b
3 changed files with 30 additions and 5 deletions

View File

@ -134,6 +134,16 @@
display: none;
}
}
&.has-addons .control {
&:not(:last-child) {
z-index: 1;
}
&:last-child {
z-index: 10;
}
}
}
.currently {

View File

@ -99,7 +99,7 @@
</div>
</div>
<b-dropdown-item
v-for="(rows, index) in [3, 10, 15, 20, 50]"
v-for="(rows, index) in [10, 25, 50, 100]"
:key="index"
:value="rows"
aria-role="listitem"

View File

@ -30,11 +30,18 @@
<div v-show="status.type === 'is-danger' || status.type === 'is-success'" class="status">
<div :class="status.type" class="status-message">{{ status.msg }}</div>
</div>
<div v-show="contributionHash" class="is-success status-message">
Your contribution hash (Blake2b) is {{ contributionHash }}
<div v-show="contributionHash" class="status">
<div class="label">Your contribution hash (Blake2b)</div>
<b-field position="is-centered">
<b-input :value="contributionHash" readonly></b-input>
<p class="control">
<b-button @click="copyСontributionHash()" type="is-primary">Copy</b-button>
</p>
</b-field>
</div>
<div v-show="authorizeLink" class="is-success status-message">
You still can authorize your contribution by following this <a :href="authorizeLink">link.</a>
<div v-show="authorizeLink" class="status">
You still can authorize your contribution by following this
<a :href="authorizeLink" class="has-text-primary">link</a>.
</div>
<div class="buttons is-centered">
@ -204,6 +211,14 @@ export default {
onAnonymousHandler() {
this.logOut()
this.contributionType = 'anonymous'
},
copyСontributionHash() {
navigator.clipboard.writeText(this.contributionHash).then(() => {
this.$buefy.toast.open({
message: 'Copied!',
type: 'is-primary'
})
})
}
}
}