status-desktop/ui/app/AppLayouts/Onboarding/views/SeedPhraseInputView.qml
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

91 lines
3.3 KiB
QML
Raw 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 QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.15
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import AppLayouts.Onboarding.controls 1.0
import AppLayouts.Onboarding.stores 1.0
import utils 1.0
import shared.panels 1.0
import shared.stores 1.0
import shared.controls 1.0
Item {
id: root
property StartupStore startupStore
QtObject {
id: d
property bool wrongSeedPhrase: root.startupStore.startupModuleInst.keycardData & Constants.predefinedKeycardData.wrongSeedPhrase
onWrongSeedPhraseChanged: {
if (wrongSeedPhrase) {
if (root.startupStore.startupModuleInst.flowType === Constants.startupFlow.firstRunOldUserImportSeedPhrase) {
seedPhraseView.setWrongSeedPhraseMessage(qsTr("Profile key pair for the inserted recovery phrase is already set up"))
return
}
seedPhraseView.setWrongSeedPhraseMessage(qsTr("Recovery phrase doesnt match the profile of an existing Keycard user on this device"))
}
else {
seedPhraseView.setWrongSeedPhraseMessage("")
}
}
}
ColumnLayout {
width: 565
implicitHeight: contentItem.implicitHeight
anchors.centerIn: parent
spacing: 24
StatusBaseText {
id: headlineText
font.pixelSize: 22
font.weight: Font.Bold
color: Theme.palette.directColor1
Layout.alignment: Qt.AlignHCenter
text: qsTr("Enter recovery phrase")
}
EnterSeedPhrase {
id: seedPhraseView
isSeedPhraseValid: root.startupStore.validMnemonic
Layout.alignment: Qt.AlignHCenter
}
StatusButton {
id: submitButton
objectName: "seedPhraseViewSubmitButton"
Layout.alignment: Qt.AlignHCenter
enabled: seedPhraseView.seedPhraseIsValid
text: {
if (root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunNewUserImportSeedPhrase) {
return qsTr("Import")
}
else if (root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunOldUserImportSeedPhrase) {
return qsTr("Restore Status Profile")
}
else if (root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunOldUserKeycardImport ||
root.startupStore.currentStartupState.flowType === Constants.startupFlow.appLogin) {
return qsTr("Recover Keycard")
}
else if (root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunNewUserImportSeedPhraseIntoKeycard ||
root.startupStore.currentStartupState.flowType === Constants.startupFlow.lostKeycardReplacement ||
root.startupStore.currentStartupState.flowType === Constants.startupFlow.lostKeycardConvertToRegularAccount) {
return qsTr("Next")
}
return ""
}
onClicked: root.startupStore.doPrimaryAction()
}
}
}