Browse Source

Added updating account name

kb/add-usage-guide
Matthew Aaron Raymer 2 years ago
parent
commit
68eb04c137
  1. 10
      src/views/AccountViewView.vue
  2. 28
      src/views/NewEditAccountView.vue

10
src/views/AccountViewView.vue

@ -72,7 +72,7 @@
<!-- Identity Details --> <!-- Identity Details -->
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4"> <div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
<h2 class="text-xl font-semibold mb-2">Firstname Lastname</h2> <h2 class="text-xl font-semibold mb-2">{{ firstName }} {{ lastName }}</h2>
<div class="text-slate-500 text-sm font-bold">ID</div> <div class="text-slate-500 text-sm font-bold">ID</div>
<div <div
@ -184,6 +184,14 @@ import { ref } from "vue";
components: {}, components: {},
}) })
export default class AccountViewView extends Vue { export default class AccountViewView extends Vue {
firstName =
localStorage.getItem("firstName") === null
? "--"
: localStorage.getItem("firstName");
lastName =
localStorage.getItem("lastName") === null
? "--"
: localStorage.getItem("lastName");
mnemonic = ""; mnemonic = "";
address = ""; address = "";
privateHex = ""; privateHex = "";

28
src/views/NewEditAccountView.vue

@ -18,17 +18,20 @@
type="text" type="text"
placeholder="First Name" placeholder="First Name"
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2" class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
v-model="firstName"
/> />
<input <input
type="text" type="text"
placeholder="Last Name" placeholder="Last Name"
class="block w-full rounded border border-slate-400 mb-4 px-3 py-2" class="block w-full rounded border border-slate-400 mb-4 px-3 py-2"
v-model="lastName"
/> />
<div class="mt-8"> <div class="mt-8">
<button <button
type="button" type="button"
class="block w-full text-center text-lg font-bold uppercase bg-blue-600 text-white px-2 py-3 rounded-md mb-2" class="block w-full text-center text-lg font-bold uppercase bg-blue-600 text-white px-2 py-3 rounded-md mb-2"
@click="onClickSaveChanges()"
> >
Save Changes Save Changes
</button> </button>
@ -36,6 +39,7 @@
<button <button
type="button" type="button"
class="block w-full text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md" class="block w-full text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md"
@click="onClickCancel()"
> >
Cancel Cancel
</button> </button>
@ -50,5 +54,27 @@ import { Options, Vue } from "vue-class-component";
@Options({ @Options({
components: {}, components: {},
}) })
export default class NewEditAccountView extends Vue {} export default class NewEditAccountView extends Vue {
firstName =
localStorage.getItem("firstName") === null
? "--"
: localStorage.getItem("firstName");
lastName =
localStorage.getItem("lastName") === null
? "--"
: localStorage.getItem("lastName");
onClickSaveChanges() {
localStorage.setItem("firstName", this.firstName as string);
localStorage.setItem("lastName", this.lastName as string);
const route = {
name: "account",
};
this.$router.push(route);
}
onClickCancel() {
this.$router.back();
}
}
</script> </script>

Loading…
Cancel
Save