status-desktop/ui/app/AppLayouts/Onboarding2/UnblockWithSeedphraseFlow.qml
Michał Cieślak d1ac45ce6c Onboarding: KeycardCreatePinPage and SeedphrasePage refactored to be pure UI components
Now those components are not aware of any logic in the upper layer,
making the flows more structured and easier to follow.

Required for: #17232
2025-02-12 13:54:46 +01:00

54 lines
1.3 KiB
QML

import QtQuick 2.15
import QtQuick.Controls 2.15
import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Core.Utils 0.1 as SQUtils
import StatusQ.Core.Backpressure 0.1
import AppLayouts.Onboarding2.pages 1.0
import AppLayouts.Onboarding.enums 1.0
SQUtils.QObject {
id: root
required property StackView stackView
required property var isSeedPhraseValid
required property int keycardPinInfoPageDelay
signal seedphraseSubmitted(string seedphrase)
signal setPinRequested(string pin)
function init() {
root.stackView.push(seedphrasePage)
}
Component {
id: seedphrasePage
SeedphrasePage {
title: qsTr("Unblock Keycard using the recovery phrase")
btnContinueText: qsTr("Unblock Keycard")
isSeedPhraseValid: root.isSeedPhraseValid
onSeedphraseSubmitted: (seedphrase) => {
root.seedphraseSubmitted(seedphrase)
root.stackView.push(keycardCreatePinPage)
}
}
}
Component {
id: keycardCreatePinPage
KeycardCreatePinPage {
onSetPinRequested: (pin) => {
Backpressure.debounce(root, root.keycardPinInfoPageDelay, () => {
root.setPinRequested(pin)
})()
}
}
}
}