Skip to content

Commit

Permalink
feat(Onboarding): Create Profile
Browse files Browse the repository at this point in the history
- implements the basic Onboarding UI skeleton and the Create Profile
flow

Fixes #16719
  • Loading branch information
caybro committed Nov 8, 2024
1 parent d6d5467 commit 9e0076b
Show file tree
Hide file tree
Showing 33 changed files with 1,331 additions and 114 deletions.
117 changes: 117 additions & 0 deletions storybook/pages/OnboardingLayoutPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQml 2.15

import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Utils 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Core.Theme 0.1

import Models 1.0
import Storybook 1.0

import utils 1.0

import AppLayouts.Onboarding2 1.0

import shared.stores 1.0 as SharedStores

// compat
import AppLayouts.Onboarding.stores 1.0 as OOBS

SplitView {
id: root
orientation: Qt.Vertical

Logs { id: logs }

OnboardingLayout {
id: onboarding
SplitView.fillWidth: true
SplitView.fillHeight: true
startupStore: OOBS.StartupStore {
function getPasswordStrengthScore(password) {
return Math.min(password.length, 4)
}
function validMnemonic(mnemonic) {
return true
}
}
metricsStore: SharedStores.MetricsStore {
readonly property var d: QtObject {
id: d
property bool isCentralizedMetricsEnabled
}

function toggleCentralizedMetrics(enabled) {
d.isCentralizedMetricsEnabled = enabled
}

function addCentralizedMetricIfEnabled(eventName, eventValue = null) {}

readonly property bool isCentralizedMetricsEnabled : d.isCentralizedMetricsEnabled
}
splashScreenDurationMs: 3000

QtObject {
id: localAppSettings
property bool metricsPopupSeen
}

onFinished: (success, primaryPath, secondaryPath) => {
console.warn("!!! ONBOARDING FINISHED; success:", success, "; primary path:", primaryPath, "; secondary:", secondaryPath)
logs.logEvent("onFinished", ["success", "primaryPath", "secondaryPath"], arguments)

console.warn("!!! RESTARTING FLOW")
restartFlow()
}
}

LogsAndControlsPanel {
id: logsAndControlsPanel

SplitView.minimumHeight: 150
SplitView.preferredHeight: 150

logsView.logText: logs.logText

RowLayout {
anchors.fill: parent
ColumnLayout {
Layout.fillWidth: true
Label {
text: "Current page: %1".arg(onboarding.stack.currentItem ? onboarding.stack.currentItem.title : "")
}
Label {
text: `Current path: ${onboarding.primaryPath} -> ${onboarding.secondaryPath}`
}
Label {
text: "Stack depth: %1".arg(onboarding.stack.depth)
}
}
Item { Layout.fillWidth: true }
Button {
text: "Restart"
focusPolicy: Qt.NoFocus
onClicked: onboarding.restartFlow()
}
Button {
text: "Copy password"
focusPolicy: Qt.NoFocus
onClicked: ClipboardUtils.setText("0123456789")
}
Button {
text: "Copy seedphrase"
focusPolicy: Qt.NoFocus
onClicked: ClipboardUtils.setText("dog dog dog dog dog dog dog dog dog dog dog dog")
}
}
}
}

// category: Onboarding
// status: good
// https://www.figma.com/design/Lw4nPYQcZOPOwTgETiiIYo/Desktop-Onboarding-Redesign?node-id=1-25&node-type=canvas&m=dev
2 changes: 1 addition & 1 deletion storybook/stubs/shared/stores/BIP39_en.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ListModel {

Component.onCompleted: {
var englishWords = [
"apple", "banana", "cat", "cow", "catalog", "catch", "category", "cattle", "dog", "elephant", "fish", "grape", "horse", "ice cream", "jellyfish",
"age", "agent", "apple", "banana", "cat", "cow", "catalog", "catch", "category", "cattle", "dog", "elephant", "fish", "grape", "horse", "ice cream", "jellyfish",
"kiwi", "lemon", "mango", "nut", "orange", "pear", "quail", "rabbit", "strawberry", "turtle",
"umbrella", "violet", "watermelon", "xylophone", "yogurt", "zebra"
// Add more English words here...
Expand Down
3 changes: 3 additions & 0 deletions storybook/stubs/shared/stores/MetricsStore.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import QtQml 2.15

QtObject {}
1 change: 1 addition & 0 deletions storybook/stubs/shared/stores/qmldir
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ PermissionsStore 1.0 PermissionsStore.qml
ProfileStore 1.0 ProfileStore.qml
RootStore 1.0 RootStore.qml
UtilsStore 1.0 UtilsStore.qml
MetricsStore 1.0 MetricsStore.qml
3 changes: 1 addition & 2 deletions ui/StatusQ/src/StatusQ/Components/StatusImage.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import QtQuick 2.13
import QtQuick.Window 2.15
import QtQuick 2.15

/*!
\qmltype StatusImage
Expand Down
1 change: 1 addition & 0 deletions ui/StatusQ/src/StatusQ/Components/StatusSmartIdenticon.qml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Loader {
objectName: "statusRoundImage"
width: parent.width
height: parent.height
radius: asset.bgRadius
image.source: root.asset.isImage ? root.asset.name : ""
showLoadingIndicator: true
border.width: root.asset.imgIsIdenticon ? 1 : 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ StatusProgressBar {
Default value: "So-so"
*/
property string labelSoso: qsTr("So-so")
property string labelSoso: qsTr("Okay")
/*!
\qmlproperty string StatusPasswordStrengthIndicator::labelGood
This property holds the text shown when the strength is StatusPasswordStrengthIndicator.Strength.Good.
Expand All @@ -88,7 +88,7 @@ StatusProgressBar {
Default value: "Great"
*/
property string labelGreat: qsTr("Great")
property string labelGreat: qsTr("Very strong")

enum Strength {
None, // 0
Expand Down
24 changes: 24 additions & 0 deletions ui/StatusQ/src/StatusQ/Popups/StatusSimpleTextPopup.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import QtQuick 2.15
import QtQuick.Controls 2.15

import StatusQ.Core 0.1
import StatusQ.Popups.Dialog 0.1

StatusDialog {
width: 600
padding: 0
standardButtons: Dialog.Ok

property alias content: contentText

StatusScrollView {
id: scrollView
anchors.fill: parent
contentWidth: availableWidth
StatusBaseText {
id: contentText
width: scrollView.availableWidth
wrapMode: Text.Wrap
}
}
}
1 change: 1 addition & 0 deletions ui/StatusQ/src/StatusQ/Popups/qmldir
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ StatusModalDivider 0.1 StatusModalDivider.qml
StatusSearchLocationMenu 0.1 StatusSearchLocationMenu.qml
StatusSearchPopup 0.1 StatusSearchPopup.qml
StatusSearchPopupMenuItem 0.1 StatusSearchPopupMenuItem.qml
StatusSimpleTextPopup 0.1 StatusSimpleTextPopup.qml
StatusStackModal 0.1 StatusStackModal.qml
StatusSuccessAction 0.1 StatusSuccessAction.qml
5 changes: 5 additions & 0 deletions ui/StatusQ/src/assets.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -8339,6 +8339,11 @@
<file>assets/png/onboarding/profile_fetching_in_progress.png</file>
<file>assets/png/onboarding/seed-phrase.png</file>
<file>assets/png/onboarding/welcome.png</file>
<file>assets/png/onboarding/status_totebag_artwork_1.png</file>
<file>assets/png/onboarding/status_generate_keys.png</file>
<file>assets/png/onboarding/create_profile_seed.png</file>
<file>assets/png/onboarding/create_profile_keycard.png</file>
<file>assets/png/onboarding/enable_biometrics.png</file>
<file>assets/png/onRampProviders/latamex.png</file>
<file>assets/png/onRampProviders/mercuryo.png</file>
<file>assets/png/onRampProviders/moonPay.png</file>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ui/StatusQ/src/statusq.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
<file>StatusQ/Popups/StatusSearchLocationMenu.qml</file>
<file>StatusQ/Popups/StatusSearchPopup.qml</file>
<file>StatusQ/Popups/StatusSearchPopupMenuItem.qml</file>
<file>StatusQ/Popups/StatusSimpleTextPopup.qml</file>
<file>StatusQ/Popups/StatusStackModal.qml</file>
<file>StatusQ/Popups/StatusSuccessAction.qml</file>
<file>StatusQ/Popups/qmldir</file>
Expand Down
Loading

0 comments on commit 9e0076b

Please sign in to comment.