Skip to content

Commit

Permalink
add copy button (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc authored Aug 10, 2024
1 parent 2ab3821 commit 73dac78
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/components/MintDetailsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@
<span v-else class="text-weight-bold q-mr-xs">
{{ contactMethods[contactInfo.method] }}
</span>
{{ contactInfo.info }}
{{ shortenText(contactInfo.info, 30) }}
<q-icon
name="content_copy"
@click="copyText(contactInfo.info)"
size="1em"
color="grey"
class="q-mr-xs cursor-pointer"
/>
</q-item-label>
</div>
</div>
Expand Down Expand Up @@ -164,6 +171,13 @@ export default defineComponent({
...mapState(useMintsStore, ["showMintInfoData"]),
...mapWritableState(useMintsStore, ["showMintInfoDialog"]),
},
methods: {},
methods: {
shortenText: function (text, maxLength) {
if (text.length > maxLength) {
return text.substring(0, maxLength) + "...";
}
return text;
},
},
});
</script>

0 comments on commit 73dac78

Please sign in to comment.