fix(LoginView): add button to add existing user

Also ensure both buttons, add existing and add new user are navigating
to the correct screens as per latest design discussions.
This commit is contained in:
Pascal Precht 2022-05-11 16:45:15 +02:00 committed by Iuri Matias
parent edbaccd6bf
commit c55c93ed59
3 changed files with 23 additions and 7 deletions

View File

@ -9,6 +9,7 @@ QtObject {
id: root
property bool hasAccounts
property string keysMainSetState: ""
property string prevState: ""
signal loadApp()
signal onBoardingStepChanged(var view, string state)
@ -197,7 +198,7 @@ QtObject {
Global.applicationWindow.navigateTo("ImportSeed");
}
onBackClicked: {
if (root.keysMainSetState === "connectkeys" && LoginStore.currentAccount.username !== "") {
if ((root.keysMainSetState === "connectkeys" && LoginStore.currentAccount.username !== "") || root.prevState === "LogIn") {
Global.applicationWindow.navigateTo("LogIn");
} else {
Global.applicationWindow.navigateTo("Welcome");
@ -255,11 +256,14 @@ QtObject {
property var loginComponent: Component {
id: login
LoginView {
onGenKeyClicked: {
Global.applicationWindow.navigateTo("GenKey");
onAddNewUserClicked: {
root.keysMainSetState = "getkeys";
root.prevState = "LogIn"
Global.applicationWindow.navigateTo("KeysMain");
}
onAddExistingKeyClicked: {
root.keysMainSetState = "connectkeys";
root.prevState = "LogIn"
Global.applicationWindow.navigateTo("KeysMain");
}
}

View File

@ -17,6 +17,9 @@ MenuItem {
property string colorId: ""
property var colorHash
property url image: ""
property StatusIconSettings iconSettings: StatusIconSettings {
name: "add"
}
signal clicked()
width: parent.width
@ -43,7 +46,7 @@ MenuItem {
Component {
id: addIcon
StatusRoundIcon {
icon.name: "add"
icon.name: root.iconSettings.name
}
}

View File

@ -24,7 +24,7 @@ import utils 1.0
Item {
property bool loading: false
signal genKeyClicked()
signal addNewUserClicked()
signal addExistingKeyClicked()
id: loginView
@ -197,10 +197,19 @@ Item {
}
AccountMenuItemPanel {
label: qsTr("Generate new account")
label: qsTr("Add new user")
onClicked: {
accountsPopup.close()
genKeyClicked();
addNewUserClicked();
}
}
AccountMenuItemPanel {
label: qsTr("Add existing Status user")
iconSettings.name: "wallet"
onClicked: {
accountsPopup.close()
addExistingKeyClicked();
}
}
}