mirror of
https://github.com/lnbits/lnbits.git
synced 2025-04-21 22:14:57 +02:00
feat: add Copy
button for addresses
This commit is contained in:
parent
a6fba27554
commit
3d1ea76676
@ -111,7 +111,7 @@
|
||||
<q-td colspan="100%">
|
||||
<div class="row items-center q-mt-md q-mb-lg">
|
||||
<div class="col-2 q-pr-lg"></div>
|
||||
<div class="col-4 q-pr-lg">
|
||||
<div class="col-2 q-pr-lg">
|
||||
<q-btn
|
||||
unelevated
|
||||
dense
|
||||
@ -123,6 +123,16 @@
|
||||
QR Code</q-btn
|
||||
>
|
||||
</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">
|
||||
<q-btn
|
||||
outline
|
||||
|
@ -74,6 +74,16 @@ async function addressList(path) {
|
||||
satBtc(val, showUnit = true) {
|
||||
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) {
|
||||
const wallet = (this.accounts || []).find(wl => wl.id === walletId)
|
||||
return wallet ? wallet.title : 'unknown'
|
||||
|
@ -170,7 +170,17 @@
|
||||
></qrcode>
|
||||
</q-responsive>
|
||||
<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 }}
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
|
Loading…
x
Reference in New Issue
Block a user