fix(@desktop/wallet): Fix backup warning
Also prevent backup warning to be double when we switch wallet 2 to 1
This commit is contained in:
parent
14c4ee6047
commit
712c75f051
|
@ -0,0 +1,92 @@
|
||||||
|
import QtQuick 2.13
|
||||||
|
import QtQuick.Controls 2.13
|
||||||
|
import QtQuick.Layouts 1.13
|
||||||
|
import QtGraphicalEffects 1.13
|
||||||
|
import "../../../imports"
|
||||||
|
import "../../../shared"
|
||||||
|
import "../Profile/Sections"
|
||||||
|
import "."
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
visible: !profileModel.mnemonic.isBackedUp
|
||||||
|
height: visible ? 32 : 0
|
||||||
|
color: Style.current.red
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: Style.current.halfPadding
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
//% "Back up your seed phrase"
|
||||||
|
text: qsTrId("back-up-your-seed-phrase")
|
||||||
|
font.pixelSize: 13
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
color: Style.current.white
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
width: 58
|
||||||
|
height: 24
|
||||||
|
contentItem: Item {
|
||||||
|
anchors.fill: parent
|
||||||
|
Text {
|
||||||
|
text: "Back up"
|
||||||
|
font.pixelSize: 13
|
||||||
|
font.weight: Font.Medium
|
||||||
|
font.family: Style.current.fontRegular.name
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
color: Style.current.white
|
||||||
|
}
|
||||||
|
}
|
||||||
|
background: Rectangle {
|
||||||
|
radius: 4
|
||||||
|
anchors.fill: parent
|
||||||
|
border.color: Style.current.white
|
||||||
|
color: "#19FFFFFF"
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: backupSeedModal.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SVGImage {
|
||||||
|
id: closeImg
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 6
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 18
|
||||||
|
source: "../../img/close-white.svg"
|
||||||
|
height: 20
|
||||||
|
width: 20
|
||||||
|
}
|
||||||
|
ColorOverlay {
|
||||||
|
anchors.fill: closeImg
|
||||||
|
source: closeImg
|
||||||
|
color: Style.current.white
|
||||||
|
opacity: 0.7
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: closeImg
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: ParallelAnimation {
|
||||||
|
PropertyAnimation { target: root; property: "visible"; to: false; }
|
||||||
|
PropertyAnimation { target: root; property: "y"; to: -1 * root.height }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BackupSeedModal {
|
||||||
|
id: backupSeedModal
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -22,8 +22,17 @@ Item {
|
||||||
id: signPhrasePopup
|
id: signPhrasePopup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SeedPhraseBackupWarning {
|
||||||
|
id: seedPhraseWarning
|
||||||
|
width: parent.width
|
||||||
|
anchors.top: parent.top
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
StatusAppTwoPanelLayout {
|
StatusAppTwoPanelLayout {
|
||||||
anchors.fill: parent
|
anchors.top: seedPhraseWarning.bottom
|
||||||
|
height: walletView.height - seedPhraseWarning.height
|
||||||
|
width: walletView.width
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if(onboardingModel.firstTimeLogin){
|
if(onboardingModel.firstTimeLogin){
|
||||||
|
|
|
@ -181,25 +181,12 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleWarning {
|
|
||||||
id: mnemonicBackupWarning
|
|
||||||
width: parent.width
|
|
||||||
visible: appSettings.isWalletEnabled && !profileModel.mnemonic.isBackedUp && appView.currentIndex == Utils.getAppSectionIndex(Constants.wallet)
|
|
||||||
color: Style.current.red
|
|
||||||
//% "Back up your seed phrase"
|
|
||||||
text: qsTrId("back-up-your-seed-phrase")
|
|
||||||
btnText: qsTr("Back up")
|
|
||||||
onClick: function() {
|
|
||||||
openPopup(backupSeedModalComponent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusAppLayout {
|
StatusAppLayout {
|
||||||
id: appLayout
|
id: appLayout
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: (versionWarning.visible || mnemonicBackupWarning.visible) ? 32 : 0
|
anchors.topMargin: versionWarning.visible ? 32 : 0
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
appNavBar: StatusAppNavBar {
|
appNavBar: StatusAppNavBar {
|
||||||
|
|
Loading…
Reference in New Issue