Skip to content

Commit

Permalink
Add Copy Icon next to address in Twin page. (#1193)
Browse files Browse the repository at this point in the history
* add copy icon next to address

* update icon size

* add icon at end of row

* uptade to custom_toast

* fix style
  • Loading branch information
AlaaElattar authored Oct 11, 2023
1 parent c12f6d9 commit 6be0068
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/playground/src/portal/twin_view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
<v-col cols="1" sm="10" class="my-4">
<v-list-item> {{ profileManager.profile?.twinId.toString() }} </v-list-item>
<v-divider></v-divider>
<v-list-item> {{ profileManager.profile?.address }} </v-list-item>
<v-list-item>
<div style="display: flex; justify-content: space-between; align-items: center">
<span>{{ profileManager.profile?.address }}</span>
<v-icon @click="copy(profileManager.profile?.address as string)"> mdi-content-copy </v-icon>
</div>
</v-list-item>
<v-divider></v-divider>
<v-list-item> {{ profileManager.profile?.relay }} </v-list-item>
</v-col>
Expand All @@ -51,6 +56,7 @@ import { generatePublicKey } from "@threefold/rmb_direct_client";
import { onMounted, ref } from "vue";
import { useProfileManager } from "../stores";
import { createCustomToast, ToastType } from "../utils/custom_toast";
import { getGrid } from "../utils/grid";
const profileManager = useProfileManager();
Expand Down Expand Up @@ -94,6 +100,11 @@ async function UpdateRelay() {
console.log("could not update relay or pk, Error: ", e);
}
}
function copy(id: string) {
navigator.clipboard.writeText(id);
createCustomToast("Address copied to clipboard", ToastType.success);
}
</script>

<style>
Expand Down

0 comments on commit 6be0068

Please sign in to comment.