feat: add Copy button for addresses
This commit is contained in:
parent
a6fba27554
commit
3d1ea76676
3 changed files with 31 additions and 1 deletions
|
|
@ -111,7 +111,7 @@
|
||||||
<q-td colspan="100%">
|
<q-td colspan="100%">
|
||||||
<div class="row items-center q-mt-md q-mb-lg">
|
<div class="row items-center q-mt-md q-mb-lg">
|
||||||
<div class="col-2 q-pr-lg"></div>
|
<div class="col-2 q-pr-lg"></div>
|
||||||
<div class="col-4 q-pr-lg">
|
<div class="col-2 q-pr-lg">
|
||||||
<q-btn
|
<q-btn
|
||||||
unelevated
|
unelevated
|
||||||
dense
|
dense
|
||||||
|
|
@ -123,6 +123,16 @@
|
||||||
QR Code</q-btn
|
QR Code</q-btn
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-2 q-pr-lg">
|
||||||
|
<q-btn
|
||||||
|
outline
|
||||||
|
color="grey"
|
||||||
|
icon="content_copy"
|
||||||
|
@click="copyText(props.row.address)"
|
||||||
|
class="q-ml-sm"
|
||||||
|
>Copy</q-btn
|
||||||
|
>
|
||||||
|
</div>
|
||||||
<div class="col-2 q-pr-lg">
|
<div class="col-2 q-pr-lg">
|
||||||
<q-btn
|
<q-btn
|
||||||
outline
|
outline
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,16 @@ async function addressList(path) {
|
||||||
satBtc(val, showUnit = true) {
|
satBtc(val, showUnit = true) {
|
||||||
return satOrBtc(val, showUnit, this.satsDenominated)
|
return satOrBtc(val, showUnit, this.satsDenominated)
|
||||||
},
|
},
|
||||||
|
// todo: bad. base.js not present in custom components
|
||||||
|
copyText: function (text, message, position) {
|
||||||
|
var notify = this.$q.notify
|
||||||
|
Quasar.utils.copyToClipboard(text).then(function () {
|
||||||
|
notify({
|
||||||
|
message: message || 'Copied to clipboard!',
|
||||||
|
position: position || 'bottom'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
getWalletName: function (walletId) {
|
getWalletName: function (walletId) {
|
||||||
const wallet = (this.accounts || []).find(wl => wl.id === walletId)
|
const wallet = (this.accounts || []).find(wl => wl.id === walletId)
|
||||||
return wallet ? wallet.title : 'unknown'
|
return wallet ? wallet.title : 'unknown'
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,17 @@
|
||||||
></qrcode>
|
></qrcode>
|
||||||
</q-responsive>
|
</q-responsive>
|
||||||
<p v-if="currentAddress">
|
<p v-if="currentAddress">
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
size="ms"
|
||||||
|
icon="content_copy"
|
||||||
|
@click="copyText(props.row.address)"
|
||||||
|
class="q-ml-sm"
|
||||||
|
></q-btn>
|
||||||
|
|
||||||
{{ currentAddress.address }}
|
{{ currentAddress.address }}
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue