2023-03-20 12:29:05 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
2024-02-09 11:05:51 +00:00
|
|
|
import QtQuick.Layouts 1.15
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Utils 0.1 as CoreUtils
|
|
|
|
|
|
|
|
import mainui 1.0
|
|
|
|
import AppLayouts.Profile.panels 1.0
|
2023-10-23 11:36:33 +00:00
|
|
|
import shared.stores 1.0
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
2024-01-13 03:24:57 +00:00
|
|
|
import AppLayouts.Wallet.stores 1.0
|
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
SplitView {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
|
|
|
Popups {
|
|
|
|
popupParent: root
|
|
|
|
rootStore: QtObject {}
|
2023-10-23 11:36:33 +00:00
|
|
|
communityTokensStore: CommunityTokensStore {}
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
|
2024-01-13 03:24:57 +00:00
|
|
|
readonly property WalletAssetsStore walletAssetStore: WalletAssetsStore {
|
|
|
|
assetsWithFilteredBalances: walletAssetStore.groupedAccountsAssetsModel
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
|
2023-11-09 14:24:05 +00:00
|
|
|
ListModel {
|
|
|
|
id: inShowcaseAssetsModel
|
|
|
|
|
|
|
|
signal baseModelFilterConditionsMayHaveChanged()
|
|
|
|
|
|
|
|
function setVisibilityByIndex(index, visibility) {
|
|
|
|
if (visibility === Constants.ShowcaseVisibility.NoOne) {
|
|
|
|
remove(index)
|
|
|
|
} else {
|
2024-02-07 14:56:45 +00:00
|
|
|
get(index).showcaseVisibility = visibility
|
2023-11-09 14:24:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function setVisibility(symbol, visibility) {
|
|
|
|
for (let i = 0; i < count; ++i) {
|
|
|
|
if (get(i).symbol === symbol) {
|
|
|
|
setVisibilityByIndex(i, visibility)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function hasItemInShowcase(symbol) {
|
|
|
|
for (let i = 0; i < count; ++i) {
|
|
|
|
if (get(i).symbol === symbol) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
function upsertItemJson(item) {
|
|
|
|
append(JSON.parse(item))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
StatusScrollView { // wrapped in a ScrollView on purpose; to simulate SettingsContentBase.qml
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.preferredHeight: 500
|
2024-02-09 11:05:51 +00:00
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
ProfileShowcaseAssetsPanel {
|
|
|
|
id: showcasePanel
|
|
|
|
width: 500
|
2024-01-13 03:24:57 +00:00
|
|
|
baseModel: walletAssetStore.groupedAccountAssetsModel
|
2023-11-09 14:24:05 +00:00
|
|
|
showcaseModel: inShowcaseAssetsModel
|
2024-02-09 11:05:51 +00:00
|
|
|
addAccountsButtonVisible: !hasAllAccountsChecker.checked
|
|
|
|
|
2024-01-13 03:24:57 +00:00
|
|
|
formatCurrencyAmount: function (amount, symbol) {
|
|
|
|
return ({amount: amount,
|
2024-02-07 14:56:45 +00:00
|
|
|
symbol: symbol.toUpperCase(),
|
|
|
|
displayDecimals: 4,
|
|
|
|
stripTrailingZeroes: false})
|
2024-01-13 03:24:57 +00:00
|
|
|
}
|
2024-02-09 11:05:51 +00:00
|
|
|
|
|
|
|
onNavigateToAccountsTab: logs.logEvent("ProfileShowcaseAccountsPanel::onNavigateToAccountsTab")
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 200
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
|
2024-02-09 11:05:51 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Button {
|
|
|
|
text: "Reset (clear settings)"
|
|
|
|
|
|
|
|
onClicked: showcasePanel.settings.reset()
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: hasAllAccountsChecker
|
|
|
|
|
|
|
|
text: "Has the user already shared all of their accounts"
|
|
|
|
checked: true
|
|
|
|
}
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Panels
|
2023-10-03 11:56:30 +00:00
|
|
|
|
|
|
|
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?node-id=14588-319260&t=RkXAEv3G6mp3EUvl-0
|
|
|
|
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?node-id=14609-238808&t=RkXAEv3G6mp3EUvl-0
|
|
|
|
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?node-id=14609-239912&t=RkXAEv3G6mp3EUvl-0
|
|
|
|
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?node-id=14609-240991&t=RkXAEv3G6mp3EUvl-0
|
2024-02-09 11:05:51 +00:00
|
|
|
// https://www.figma.com/file/ibJOTPlNtIxESwS96vJb06/%F0%9F%91%A4-Profile-%7C-Desktop?type=design&node-id=2460%3A30679&mode=design&t=6rs9xMrPv4sGZKe4-1
|