Skip to content

Commit

Permalink
Added Hex seed to profile manager (#3765)
Browse files Browse the repository at this point in the history
* Added Hex seed to profile manager

* Fixed the copy button and added a tooltip

* Added Link to Threefold connect in manual

* Centering the qrcode section

* Removing the threefold connect link

* Only showing mnemonics field if it's different than the hexseed
  • Loading branch information
maayarosama authored Jan 12, 2025
1 parent 761fc1e commit b5ce9cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/playground/src/stores/profile_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface Profile {
pk: string;
keypairType: KeypairType | undefined;
email: string;
hexSeed: string;
}

export interface State {
Expand Down
1 change: 1 addition & 0 deletions packages/playground/src/utils/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export async function loadProfile(grid: GridClient): Promise<Profile> {
pk: (await grid.twins.get({ id: grid!.twinId })).pk,
keypairType: grid.clientOptions!.keypairType,
email: await readEmail(grid),
hexSeed: grid.clientOptions!.mnemonic,
};
}

Expand Down
18 changes: 11 additions & 7 deletions packages/playground/src/weblets/profile_manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -356,19 +356,23 @@
<template v-if="profileManager.profile">
<v-row>
<v-col cols="12" md="6" lg="6" xl="6">
<PasswordInputWrapper #="{ props }">
<PasswordInputWrapper
#="{ props }"
v-if="profileManager.profile.mnemonic !== profileManager.profile.hexSeed"
>
<VTextField
:label="
profileManager.profile.mnemonic.startsWith('0x') || profileManager.profile.mnemonic.length === 64
? 'Your Hex Seed'
: 'Your Mnemonic'
"
:label="'Your Mnemonic'"
readonly
v-model="profileManager.profile.mnemonic"
v-bind="props"
:disabled="activating || creatingAccount || activatingAccount"
/>
</PasswordInputWrapper>
<CopyInputWrapper :data="profileManager.profile.hexSeed" #="{ props }">
<input-tooltip tooltip=" Please use this hex seed to import your wallet in Threefold Connect">
<VTextField label="Your Hex Seed" readonly v-model="profileManager.profile.hexSeed" v-bind="props" />
</input-tooltip>
</CopyInputWrapper>

<CopyInputWrapper :data="profileManager.profile.twinId.toString()" #="{ props }">
<VTextField label="Twin ID" readonly v-model="profileManager.profile.twinId" v-bind="props" />
Expand All @@ -386,7 +390,7 @@
</CopyInputWrapper>
</v-col>

<v-col cols="12" md="6" lg="6" xl="6">
<v-col cols="12" md="6" lg="6" xl="6" class="d-flex justify-center align-center">
<section class="qr d-flex flex-column align-center">
<QRPlayStore
:qr="'TFT:' + bridge + '?message=twin_' + profileManager.profile.twinId + '&sender=me&amount=100'"
Expand Down

0 comments on commit b5ce9cd

Please sign in to comment.