Lukáš Tinkl 3705249e40 feat(Onboarding): Create Profile & Login flows
- implement the basic Onboarding UI skeleton and the Create Profile
flows
- adjust the PasswordView and EnterSeedPhrase views to the latest design
- add the main OnboardingLayout and StatusPinInput pages to Storybook
- change terminology app-wide: "Seed phrase" -> "Recovery phrase"
- implement the Login flows (seed, sync, keycard)
- amend the keycard flow sequences with separate (non) empty page

Fixes #16719
Fixes #16742
Fixes #16743
2025-01-14 10:49:42 +01:00

101 lines
3.2 KiB
QML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import QtQuick 2.15
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
import shared.panels 1.0 as SharedPanels
Item {
id: root
property var sharedKeycardModule
signal validation(bool result)
QtObject {
id: d
property bool wrongSeedPhrase: root.sharedKeycardModule.keycardData & Constants.predefinedKeycardData.wrongSeedPhrase
onWrongSeedPhraseChanged: {
seedPhrase.setWrongSeedPhraseMessage(wrongSeedPhrase? qsTr("The phrase youve entered does not match this Keycards recovery phrase") : "")
}
}
StatusBaseText {
id: title
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: Theme.padding
anchors.leftMargin: Theme.xlPadding
anchors.rightMargin: Theme.xlPadding
visible: text != ""
font.pixelSize: Constants.keycard.general.fontSize1
font.weight: Font.Bold
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
}
SharedPanels.EnterSeedPhrase {
id: seedPhrase
anchors.top: title.visible? title.bottom : parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: Theme.xlPadding
anchors.bottomMargin: Theme.halfPadding
anchors.leftMargin: Theme.xlPadding
anchors.rightMargin: Theme.xlPadding
isSeedPhraseValid: function(mnemonic) {
return root.sharedKeycardModule.validSeedPhrase(mnemonic)
}
onSeedPhraseUpdated: {
if (valid) {
root.sharedKeycardModule.setSeedPhrase(seedPhrase)
}
root.validation(valid)
}
onSubmitSeedPhrase: {
root.sharedKeycardModule.currentState.doPrimaryAction()
}
}
states: [
State {
name: Constants.keycardSharedState.enterSeedPhrase
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.enterSeedPhrase
PropertyChanges {
target: title
text: {
switch (root.sharedKeycardModule.currentState.flowType) {
case Constants.keycardSharedFlow.migrateFromKeycardToApp:
return qsTr("Enter recovery phrase for %1 key pair").arg(root.sharedKeycardModule.keyPairForProcessing.name)
}
return ""
}
}
},
State {
name: Constants.keycardSharedState.wrongSeedPhrase
when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.wrongSeedPhrase
PropertyChanges {
target: title
text: {
switch (root.sharedKeycardModule.currentState.flowType) {
case Constants.keycardSharedFlow.migrateFromKeycardToApp:
return qsTr("Enter recovery phrase for %1 key pair").arg(root.sharedKeycardModule.keyPairForProcessing.name)
}
return ""
}
}
}
]
}