Browse Source

Added clipboard copy actions.

We need to add designs for feedback on the copy action
pull/1/head
Matthew Aaron Raymer 2 years ago
parent
commit
c9919987ca
  1. 11
      src/views/AccountViewView.vue

11
src/views/AccountViewView.vue

@ -80,7 +80,9 @@
> >
<span <span
><code>{{ address }}</code> ><code>{{ address }}</code>
<button @click="copy(address)">
<fa icon="copy" class="text-slate-400 fa-fw ml-1"></fa> <fa icon="copy" class="text-slate-400 fa-fw ml-1"></fa>
</button>
</span> </span>
<span> <span>
<button <button
@ -100,7 +102,9 @@
<div class="text-sm text-slate-500 mb-1"> <div class="text-sm text-slate-500 mb-1">
<span <span
><code>{{ publicHex }}</code> ><code>{{ publicHex }}</code>
<button @click="copy(publicHex)">
<fa icon="copy" class="text-slate-400 fa-fw ml-1"></fa> <fa icon="copy" class="text-slate-400 fa-fw ml-1"></fa>
</button>
</span> </span>
</div> </div>
@ -108,7 +112,9 @@
<div class="text-sm text-slate-500 mb-1"> <div class="text-sm text-slate-500 mb-1">
<span <span
><code>{{ UPORT_ROOT_DERIVATION_PATH }}</code> ><code>{{ UPORT_ROOT_DERIVATION_PATH }}</code>
<button @click="copy(UPORT_ROOT_DERIVATION_PATH)">
<fa icon="copy" class="text-slate-400 fa-fw ml-1"></fa> <fa icon="copy" class="text-slate-400 fa-fw ml-1"></fa>
</button>
</span> </span>
</div> </div>
</div> </div>
@ -167,11 +173,13 @@
<script lang="ts"> <script lang="ts">
import { Options, Vue } from "vue-class-component"; import { Options, Vue } from "vue-class-component";
import { useClipboard } from "@vueuse/core";
import { createIdentifier, deriveAddress, newIdentifier } from "../libs/crypto"; import { createIdentifier, deriveAddress, newIdentifier } from "../libs/crypto";
import { IIdentifier } from "@veramo/core"; import { IIdentifier } from "@veramo/core";
import * as R from "ramda"; import * as R from "ramda";
import { db } from "../db"; import { db } from "../db";
import { useAppStore } from "@/store/app"; import { useAppStore } from "@/store/app";
import { ref } from "vue";
@Options({ @Options({
components: {}, components: {},
@ -182,6 +190,9 @@ export default class AccountViewView extends Vue {
privateHex = ""; privateHex = "";
publicHex = ""; publicHex = "";
UPORT_ROOT_DERIVATION_PATH = ""; UPORT_ROOT_DERIVATION_PATH = "";
source = ref("Hello");
copy = useClipboard().copy;
async created() { async created() {
const previousIdentifiers: Array<IIdentifier> = []; const previousIdentifiers: Array<IIdentifier> = [];
const toLowercase = true; const toLowercase = true;

Loading…
Cancel
Save