2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
2022-06-03 10:48:03 +00:00
|
|
|
import shared.panels 1.0
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
import "stores"
|
|
|
|
import "popups"
|
|
|
|
import "views"
|
2020-05-19 19:44:45 +00:00
|
|
|
|
2021-06-16 11:15:28 +00:00
|
|
|
import StatusQ.Layout 0.1
|
2022-05-07 11:45:15 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2021-06-16 11:15:28 +00:00
|
|
|
|
|
|
|
StatusAppTwoPanelLayout {
|
|
|
|
id: profileView
|
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
property ProfileSectionStore store
|
2021-12-09 13:28:02 +00:00
|
|
|
property var globalStore
|
|
|
|
property var systemPalette
|
2022-03-10 17:01:17 +00:00
|
|
|
property var emojiPopup
|
2021-12-09 13:28:02 +00:00
|
|
|
|
2022-03-04 21:33:48 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
Global.privacyModuleInst = store.privacyStore.privacyModule
|
|
|
|
}
|
|
|
|
|
2021-12-09 13:28:02 +00:00
|
|
|
QtObject {
|
2022-05-07 11:45:15 +00:00
|
|
|
id: d
|
|
|
|
|
2022-06-03 10:48:03 +00:00
|
|
|
readonly property int topMargin: secureYourSeedPhrase.visible ? secureYourSeedPhrase.height : 0
|
2022-05-07 11:45:15 +00:00
|
|
|
readonly property int bottomMargin: 56
|
|
|
|
readonly property int leftMargin: 48
|
|
|
|
readonly property int rightMargin: 48
|
|
|
|
|
|
|
|
readonly property int contentWidth: 560
|
2021-12-09 13:28:02 +00:00
|
|
|
}
|
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
leftPanel: LeftTabView {
|
2020-05-19 19:44:45 +00:00
|
|
|
id: leftTab
|
2021-10-06 09:16:39 +00:00
|
|
|
store: profileView.store
|
|
|
|
anchors.fill: parent
|
2022-06-03 10:48:03 +00:00
|
|
|
anchors.topMargin: d.topMargin
|
2022-06-22 12:16:21 +00:00
|
|
|
onMenuItemClicked: {
|
|
|
|
if (profileContainer.currentItem.dirty) {
|
|
|
|
event.accepted = true;
|
|
|
|
profileContainer.currentItem.notifyDirty();
|
|
|
|
}
|
|
|
|
}
|
2020-05-19 19:44:45 +00:00
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
rightPanel: Item {
|
2021-06-16 11:15:28 +00:00
|
|
|
anchors.fill: parent
|
2021-04-08 15:44:58 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
StatusBanner {
|
|
|
|
id: banner
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
visible: profileContainer.currentIndex === Constants.settingsSubsection.wallet &&
|
|
|
|
profileView.store.walletStore.areTestNetworksEnabled
|
|
|
|
type: StatusBanner.Type.Danger
|
|
|
|
statusText: {
|
|
|
|
if(profileContainer.currentIndex === Constants.settingsSubsection.wallet &&
|
|
|
|
profileView.store.walletStore.areTestNetworksEnabled)
|
|
|
|
return qsTr("Testnet mode is enabled. All balances, transactions and dApp interactions will be on testnets.")
|
|
|
|
return ""
|
2020-08-04 22:22:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
StackLayout {
|
|
|
|
id: profileContainer
|
2022-03-16 21:20:03 +00:00
|
|
|
|
2022-06-22 12:16:21 +00:00
|
|
|
readonly property var currentItem: (currentIndex >= 0 && currentIndex < children.length) ? children[currentIndex] : null
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
anchors.top: banner.visible? banner.bottom : parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.topMargin: d.topMargin
|
|
|
|
anchors.bottomMargin: d.bottomMargin
|
|
|
|
anchors.leftMargin: d.leftMargin
|
|
|
|
anchors.rightMargin: d.rightMargin
|
2021-06-16 11:15:28 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
currentIndex: Global.settingsSubsection
|
2020-05-19 19:44:45 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
onCurrentIndexChanged: {
|
|
|
|
if(visibleChildren[0] === ensContainer){
|
|
|
|
ensContainer.goToStart();
|
|
|
|
}
|
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
MyProfileView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-03-07 20:34:59 +00:00
|
|
|
|
2022-06-22 12:16:21 +00:00
|
|
|
walletStore: profileView.store.walletStore
|
2022-05-07 11:45:15 +00:00
|
|
|
profileStore: profileView.store.profileStore
|
2022-06-22 12:16:21 +00:00
|
|
|
privacyStore: profileView.store.privacyStore
|
2022-05-07 11:45:15 +00:00
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.profile)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-02-11 09:44:49 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
ContactsView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
contactsStore: profileView.store.contactsStore
|
|
|
|
sectionTitle: qsTr("Contacts")
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
backButtonName: profileView.store.getNameForSubsection(Constants.settingsSubsection.messaging)
|
2020-05-24 22:23:00 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
onBackButtonClicked: {
|
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.messaging)
|
|
|
|
}
|
|
|
|
}
|
2020-05-24 22:23:00 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
EnsView {
|
|
|
|
// TODO: we need to align structure for the entire this part using `SettingsContentBase` as root component
|
|
|
|
// TODO: handle structure for this subsection to match style used in onther sections
|
|
|
|
// using `SettingsContentBase` component as base.
|
|
|
|
id: ensContainer
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
ensUsernamesStore: profileView.store.ensUsernamesStore
|
|
|
|
contactsStore: profileView.store.contactsStore
|
|
|
|
stickersStore: profileView.store.stickersStore
|
2020-10-21 14:45:28 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
profileContentWidth: d.contentWidth
|
|
|
|
}
|
2020-05-24 22:23:00 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
MessagingView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
messagingStore: profileView.store.messagingStore
|
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.messaging)
|
2022-06-28 18:11:18 +00:00
|
|
|
contactsStore: profileView.store.contactsStore
|
2022-05-07 11:45:15 +00:00
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
WalletView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
walletStore: profileView.store.walletStore
|
|
|
|
emojiPopup: profileView.emojiPopup
|
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.wallet)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
AppearanceView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
appearanceStore: profileView.store.appearanceStore
|
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.appearance)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
systemPalette: profileView.systemPalette
|
|
|
|
}
|
|
|
|
|
|
|
|
LanguageView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
languageStore: profileView.store.languageStore
|
|
|
|
currencyStore: profileView.store.walletStore.currencyStore
|
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.language)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
NotificationsView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
notificationsStore: profileView.store.notificationsStore
|
2022-04-04 11:09:23 +00:00
|
|
|
devicesStore: profileView.store.devicesStore
|
2022-05-07 11:45:15 +00:00
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.notifications)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
DevicesView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
devicesStore: profileView.store.devicesStore
|
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.devicesSettings)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
BrowserView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
store: profileView.store
|
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.browserSettings)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
AdvancedView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
advancedStore: profileView.store.advancedStore
|
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.advanced)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
AboutView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
store: profileView.store
|
|
|
|
globalStore: profileView.globalStore
|
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.about)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2022-03-23 10:56:25 +00:00
|
|
|
|
|
|
|
CommunitiesView {
|
2022-06-03 15:32:03 +00:00
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
2022-03-23 10:56:25 +00:00
|
|
|
|
|
|
|
profileSectionStore: profileView.store
|
|
|
|
rootStore: profileView.globalStore
|
|
|
|
contactStore: profileView.store.contactsStore
|
|
|
|
sectionTitle: profileView.store.getNameForSubsection(Constants.settingsSubsection.communitiesSettings)
|
|
|
|
contentWidth: d.contentWidth
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
2022-06-03 10:48:03 +00:00
|
|
|
} // Item
|
|
|
|
ModuleWarning {
|
|
|
|
id: secureYourSeedPhrase
|
|
|
|
width: parent.width
|
|
|
|
visible: profileContainer.currentIndex === Constants.settingsSubsection.profile &&
|
|
|
|
!profileView.store.profileStore.userDeclinedBackupBanner
|
|
|
|
color: Style.current.red
|
|
|
|
btnWidth: 100
|
|
|
|
text: qsTr("Secure your seed phrase")
|
|
|
|
btnText: qsTr("Back up now")
|
|
|
|
|
|
|
|
onClick: function(){
|
|
|
|
Global.openBackUpSeedPopup();
|
|
|
|
}
|
|
|
|
|
|
|
|
onClosed: {
|
|
|
|
profileView.store.profileStore.userDeclinedBackupBanner = true
|
|
|
|
}
|
|
|
|
|
2020-05-19 19:44:45 +00:00
|
|
|
}
|
2022-06-03 10:48:03 +00:00
|
|
|
} // StatusAppTwoPanelLayout
|