Lukáš Tinkl ed650d32dd chore: Remove the Browser from the app completely for now
- completely removes the `ui/app/AppLayouts/Browser` QML app section
- removes the `app_service/service/bookmarks`,
`app/modules/main/browser_section` and
`src/app_service/service/dapp_permissions` NIM modules
- remove the Browser settings page and associated popups/components
- HTML links now always open in an external browser
- adjust the section indexes in `Constants`
- fixup the e2e tests

Fixes #14614
2024-08-07 16:45:31 +02:00

140 lines
4.6 KiB
QML

import QtQuick 2.13
import QtQuick.Layouts 1.13
import StatusQ.Components 0.1
import shared 1.0
import utils 1.0
import "../stores"
Column {
id: root
spacing: 8
property PrivacyStore privacyStore
property ContactsStore contactsStore
property DevicesStore devicesStore
property alias mainMenuItems: mainMenuItems.model
property alias settingsMenuItems: settingsMenuItems.model
property alias extraMenuItems: extraMenuItems.model
property alias appsMenuItems: appsMenuItems.model
property bool walletMenuItemEnabled: false
signal menuItemClicked(var menu_item)
Repeater {
id: mainMenuItems
delegate: StatusNavigationListItem {
id: navigationItem
objectName: itemId + "-MainMenuItem"
width: root.width
itemId: model.subsection
title: model.text
asset.name: model.icon
selected: Global.settingsSubsection === model.subsection
onClicked: root.menuItemClicked(model)
badge.value: {
switch (model.subsection) {
case Constants.settingsSubsection.backUpSeed:
return !root.privacyStore.mnemonicBackedUp
case Constants.settingsSubsection.syncingSettings:
return root.devicesStore.devicesModel.count - root.devicesStore.devicesModel.pairedCount
default: return 0
}
}
visible: {
switch (model.subsection) {
case Constants.settingsSubsection.ensUsernames:
return root.walletMenuItemEnabled;
case Constants.settingsSubsection.backUpSeed:
return !root.privacyStore.mnemonicBackedUp;
default: return true;
}
}
Loader {
id: betaTagLoader
readonly property string experimentalTooltip: model.experimentalTooltip
active: model.isExperimental
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: Style.current.padding + (navigationItem.badge.visible ? navigationItem.badge.width + Style.current.halfPadding : 0)
sourceComponent: StatusBetaTag {
tooltipText: betaTagLoader.experimentalTooltip
}
}
}
}
StatusListSectionHeadline {
text: qsTr("Apps")
width: root.width
}
Repeater {
id: appsMenuItems
delegate: StatusNavigationListItem {
id: appsMenuDelegate
objectName: itemId + "-AppMenuItem"
width: root.width
itemId: model.subsection
title: model.text
asset.name: model.icon
selected: Global.settingsSubsection === model.subsection
onClicked: root.menuItemClicked(model)
visible: {
(model.subsection !== Constants.settingsSubsection.wallet) ||
(model.subsection === Constants.settingsSubsection.communitiesSettings) ||
(model.subsection === Constants.settingsSubsection.wallet && root.walletMenuItemEnabled)
}
badge.value: {
switch (model.subsection) {
case Constants.settingsSubsection.messaging:
return root.contactsStore.receivedContactRequestsModel.count
default: return ""
}
}
}
}
StatusListSectionHeadline {
text: qsTr("Preferences")
width: root.width
}
Repeater {
id: settingsMenuItems
delegate: StatusNavigationListItem {
id: settingsMenuDelegate
objectName: itemId + "-SettingsMenuItem"
width: root.width
itemId: model.subsection
title: model.text
asset.name: model.icon
selected: Global.settingsSubsection === model.subsection
onClicked: root.menuItemClicked(model)
}
}
StatusListSectionHeadline {
text: qsTr("About & Help")
width: root.width
}
Repeater {
id: extraMenuItems
delegate: StatusNavigationListItem {
objectName: itemId + "-ExtraMenuItem"
width: root.width
itemId: model.subsection
title: model.text
asset.name: model.icon
selected: Global.settingsSubsection === model.subsection
onClicked: root.menuItemClicked(model)
}
}
}