From c4e9f8dba0a70c04ae83379a6d6894375cf3859b Mon Sep 17 00:00:00 2001 From: Alex Jbanca Date: Wed, 14 Jun 2023 22:06:13 +0300 Subject: [PATCH] fix: Adding Beta user agreement --- storybook/PagesModel.qml | 4 + storybook/figma.json | 3 + storybook/pages/UserAgreementPopupPage.qml | 34 +++++ ui/app/mainui/AppMain.qml | 9 ++ .../shared/popups/UserAgreementPopup.qml | 124 ++++++++++++++++++ ui/imports/shared/popups/qmldir | 1 + ui/main.qml | 1 + 7 files changed, 176 insertions(+) create mode 100644 storybook/pages/UserAgreementPopupPage.qml create mode 100644 ui/imports/shared/popups/UserAgreementPopup.qml diff --git a/storybook/PagesModel.qml b/storybook/PagesModel.qml index 0d31eeb7a3..3d64ebbc23 100644 --- a/storybook/PagesModel.qml +++ b/storybook/PagesModel.qml @@ -217,6 +217,10 @@ ListModel { title: "SendModal" section: "Popups" } + ListElement { + title: "UserAgreementPopup" + section: "Popups" + } ListElement { title: "MembersSelector" section: "Components" diff --git a/storybook/figma.json b/storybook/figma.json index 34bdf9ce3d..3b4451c712 100644 --- a/storybook/figma.json +++ b/storybook/figma.json @@ -212,5 +212,8 @@ "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?type=design&node-id=29528%3A588403&t=GUxMZEWcfRO7pXJb-1", "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?type=design&node-id=29528%3A588563&t=GUxMZEWcfRO7pXJb-1", "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?type=design&node-id=29528%3A587660&t=GUxMZEWcfRO7pXJb-1" + ], + "UserAgreementPopup": [ + "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba⎜Desktop?type=design&node-id=31450-560694&t=Q4MOViPCoHsTjhs6-0" ] } diff --git a/storybook/pages/UserAgreementPopupPage.qml b/storybook/pages/UserAgreementPopupPage.qml new file mode 100644 index 0000000000..16aac07d25 --- /dev/null +++ b/storybook/pages/UserAgreementPopupPage.qml @@ -0,0 +1,34 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +import shared.popups 1.0 + +import Storybook 1.0 + +SplitView { + orientation: Qt.Vertical + + Item { + + SplitView.fillWidth: true + SplitView.fillHeight: true + + PopupBackground { + anchors.fill: parent + } + + Button { + anchors.centerIn: parent + text: "Reopen" + + onClicked: popup.open() + } + } + + UserAgreementPopup { + id: popup + anchors.centerIn: parent + modal: false + visible: true + } +} diff --git a/ui/app/mainui/AppMain.qml b/ui/app/mainui/AppMain.qml index 443bd2d205..9d8ecc825d 100644 --- a/ui/app/mainui/AppMain.qml +++ b/ui/app/mainui/AppMain.qml @@ -1420,4 +1420,13 @@ Item { width: appMain.width height: appMain.height } + + Loader { + id: userAgreementLoader + active: production && !localAppSettings.testEnvironment + sourceComponent: UserAgreementPopup { + visible: appMain.visible + onClosed: userAgreementLoader.active = false + } + } } diff --git a/ui/imports/shared/popups/UserAgreementPopup.qml b/ui/imports/shared/popups/UserAgreementPopup.qml new file mode 100644 index 0000000000..5f5abcd253 --- /dev/null +++ b/ui/imports/shared/popups/UserAgreementPopup.qml @@ -0,0 +1,124 @@ +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.Popups 0.1 +import StatusQ.Popups.Dialog 0.1 +import StatusQ.Components 0.1 +import StatusQ.Core.Theme 0.1 + +import utils 1.0 + +StatusModal { + id: root + width: 640 + headerSettings.title: qsTr("Welcome to Status Desktop Beta") + hasCloseButton: false + + closePolicy: Popup.NoAutoClose + + component Paragraph: StatusBaseText { + font.pixelSize: 15 + lineHeightMode: Text.FixedHeight + lineHeight: 22 + visible: !!text + wrapMode: Text.Wrap + } + + component AgreementSection: ColumnLayout { + property alias title: titleItem.text + property alias body: bodyItem.text + spacing: 12 + Paragraph { + id: titleItem + Layout.fillWidth: true + Layout.fillHeight: true + font.weight: Font.DemiBold + } + + Paragraph { + id: bodyItem + Layout.fillWidth: true + Layout.fillHeight: true + } + } + + StatusScrollView { + id: scrollView + anchors.fill: parent + contentWidth: availableWidth + + ColumnLayout { + id: layout + width: scrollView.availableWidth + spacing: 22 + StatusRoundedImage { + id: statusRoundedImage + objectName: "headerImage" + Layout.preferredWidth: 64 + Layout.preferredHeight: 64 + Layout.alignment: Qt.AlignHCenter + image.source: Style.png("status-logo") + image.mipmap: true + } + + AgreementSection { + title: qsTr("Warning - Status desktop is currently in Beta") + body: qsTr("• The Wallet is not yet safe or secure to use +• Do not use real funds in the Wallet +• Do not use accounts that contain tokens of value in the Wallet") + } + + AgreementSection { + title: qsTr("Also be aware") + body: qsTr("• Status Desktop is incompatible with Status Mobile versions 1.x +• This version of Status may break or stop working without warning +• Communities created with this version may be broken by future releases +• Status desktop currently consumes large amounts of bandwidth") + } + + AgreementSection { + body: qsTr("We are working to fix all these issues ASAP, ahead of Status Desktop’s 1.0 release!") + } + + StatusDialogDivider { + Layout.fillWidth: true + } + + AgreementSection { + body: qsTr("I confirm that...") + } + + StatusCheckBox { + id: agreeToUse + Layout.fillWidth: true + Layout.topMargin: -10 //reduced margin by design + contentItem: Paragraph { + text: qsTr("I’ve read the above and understand that Status Desktop is Beta software") + leftPadding: readyToUse.indicator.width + readyToUse.spacing + } + } + + StatusCheckBox { + id: readyToUse + Layout.fillWidth: true + Layout.topMargin: -10 //reduced margin by design + Layout.bottomMargin: layout.spacing + contentItem: Paragraph { + text: qsTr("I’m ready to use Status Desktop Beta") + leftPadding: readyToUse.indicator.width + readyToUse.spacing + } + } + } + } + + rightButtons: [ + StatusButton { + text: qsTr("I’m ready to use Status Desktop Beta") + enabled: agreeToUse.checked && readyToUse.checked + onClicked: root.close() + } + ] +} diff --git a/ui/imports/shared/popups/qmldir b/ui/imports/shared/popups/qmldir index 2b62ce4f49..45bf1fcf67 100644 --- a/ui/imports/shared/popups/qmldir +++ b/ui/imports/shared/popups/qmldir @@ -27,3 +27,4 @@ GetSyncCodeInstructionsPopup 1.0 GetSyncCodeInstructionsPopup.qml NoPermissionsToJoinPopup 1.0 NoPermissionsToJoinPopup.qml RemoveAccountConfirmationPopup 1.0 RemoveAccountConfirmationPopup.qml DeleteMessageConfirmationPopup 1.0 DeleteMessageConfirmationPopup.qml +UserAgreementPopup 1.0 UserAgreementPopup.qml diff --git a/ui/main.qml b/ui/main.qml index 16e867bce2..d0bc7fa7ad 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -323,6 +323,7 @@ StatusWindow { id: app AppMain { sysPalette: systemPalette + visible: !appLoadingAnimation.active } }