Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(seedPage): added copy button to seed page #3543

Merged
merged 4 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions pages/setup/phrase/Phrase.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,24 @@
</div>
</div>
</div>
<UiSpacer :size="45" />
<InteractablesButton
full-width
:text="$t('pages.phrase.done')"
:action="confirm"
/>
<UiSpacer :height="45" />
<div class="columns is-mobile">
<div class="column">
<InteractablesButton
full-width
:text="$t('pages.settings.accounts.copy_phrase')"
:action="copyPhrase"
>
<clipboard-icon size="1x" />
</InteractablesButton>
</div>
<div class="column">
<InteractablesButton
full-width
:text="$t('pages.phrase.done')"
:action="confirm"
/>
</div>
</div>
</div>
</div>
21 changes: 13 additions & 8 deletions pages/setup/phrase/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
<script lang="ts">
import Vue from 'vue'
import { mapState } from 'vuex'
import { AccountsState } from '~/store/accounts/types'
import { ClipboardIcon } from 'satellite-lucide-icons'
import { RootState } from '~/types/store/store'

declare module 'vue/types/vue' {
interface Vue {
accounts: AccountsState
}
}
export default Vue.extend({
name: 'PhraseScreen',
components: {
ClipboardIcon,
},
computed: {
...mapState(['accounts']),
...mapState({
passPhrase: (state) => (state as RootState).accounts.phrase,
}),
splitPhrase(): Array<String> {
return this.accounts.phrase.split(' ')
return this.passPhrase.split(' ')
},
},
methods: {
Expand All @@ -25,6 +26,10 @@ export default Vue.extend({
confirm() {
this.$router.replace('/')
},
copyPhrase() {
navigator.clipboard.writeText(this.passPhrase)
this.$toast.show(this.$t('ui.copied') as string)
},
},
})
</script>
Expand Down