status-desktop/ui/app/AppLayouts/Onboarding2/pages/CreatePasswordPage.qml
Lukáš Tinkl 7029d56cbf fix(Onboarding): fixup and extract info button to OnboardingInfoButton
- create a reusable component
- fix the bg and hover colors as specified in Figma

Fixes #17102
2025-01-28 12:13:17 +01:00

86 lines
2.7 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 StatusQ.Core 0.1
import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Popups 0.1
import utils 1.0
import shared.views 1.0
import AppLayouts.Onboarding2.controls 1.0
OnboardingPage {
id: root
property var passwordStrengthScoreFunction: (password) => { console.error("passwordStrengthScoreFunction: IMPLEMENT ME") }
signal setPasswordRequested(string password)
title: qsTr("Create profile password")
QtObject {
id: d
function submit() {
if (!passView.ready)
return
root.setPasswordRequested(passView.newPswText)
}
}
Component.onCompleted: passView.forceNewPswInputFocus()
contentItem: Item {
ColumnLayout {
spacing: Theme.padding
anchors.centerIn: parent
width: Math.min(400, root.availableWidth)
PasswordView {
id: passView
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
highSizeIntro: true
title: root.title
introText: qsTr("This password cant be recovered")
recoverText: ""
passwordStrengthScoreFunction: root.passwordStrengthScoreFunction
onReturnPressed: d.submit()
}
StatusButton {
objectName: "btnConfirmPassword"
Layout.alignment: Qt.AlignHCenter
text: qsTr("Confirm password")
enabled: passView.ready
onClicked: d.submit()
}
}
}
OnboardingInfoButton {
anchors.right: parent.right
anchors.top: parent.top
objectName: "infoButton"
onClicked: passwordDetailsPopup.createObject(root).open()
}
Component {
id: passwordDetailsPopup
StatusSimpleTextPopup {
objectName: "passwordDetailsPopup"
title: qsTr("Create profile password")
okButtonText: qsTr("Got it")
width: 480
destroyOnClose: true
content.text: qsTr("Your Status keys are the foundation of your self-sovereign identity in Web3. You have complete control over these keys, which you can use to sign transactions, access your data, and interact with Web3 services.
Your keys are always securely stored on your device and protected by your Status profile password. Status doesn't know your password and can't reset it for you. If you forget your password, you may lose access to your Status profile and wallet funds.
Remember your password and don't share it with anyone.")
}
}
}