diff --git a/storybook/pages/ProfileShowcaseAccountsPanelPage.qml b/storybook/pages/ProfileShowcaseAccountsPanelPage.qml index 20dde7a3da..21d5266ccd 100644 --- a/storybook/pages/ProfileShowcaseAccountsPanelPage.qml +++ b/storybook/pages/ProfileShowcaseAccountsPanelPage.qml @@ -30,6 +30,7 @@ SplitView { ListModel { id: accountsModel + ListElement { name: "My Status Account" address: "0xcdc2ea3b6ba8fed3a3402f8db8b2fab53e7b7420" @@ -60,6 +61,41 @@ SplitView { } } + ListModel { + id: inShowcaseAccountsModel + + signal baseModelFilterConditionsMayHaveChanged() + + function setVisibilityByIndex(index, visibility) { + if (visibility === Constants.ShowcaseVisibility.NoOne) { + remove(index) + } else { + get(index).showcaseVisibility = visibility + } + } + + function setVisibility(address, visibility) { + for (let i = 0; i < count; ++i) { + if (get(i).address === address) { + setVisibilityByIndex(i, visibility) + } + } + } + + function hasItemInShowcase(address) { + for (let i = 0; i < count; ++i) { + if (get(i).address === address) { + return true + } + } + return false + } + + function upsertItemJson(item) { + append(JSON.parse(item)) + } + } + StatusScrollView { // wrapped in a ScrollView on purpose; to simulate SettingsContentBase.qml SplitView.fillWidth: true SplitView.preferredHeight: 500 @@ -67,6 +103,7 @@ SplitView { id: showcasePanel width: 500 baseModel: accountsModel + showcaseModel: inShowcaseAccountsModel currentWallet: root.currentWallet } } diff --git a/storybook/pages/ProfileShowcaseAssetsPanelPage.qml b/storybook/pages/ProfileShowcaseAssetsPanelPage.qml index 03778f2ae9..217dd4e46c 100644 --- a/storybook/pages/ProfileShowcaseAssetsPanelPage.qml +++ b/storybook/pages/ProfileShowcaseAssetsPanelPage.qml @@ -28,6 +28,7 @@ SplitView { ListModel { id: assetsModel + readonly property var data: [ { name: "Decentraland", @@ -84,6 +85,41 @@ SplitView { Component.onCompleted: append(data) } + ListModel { + id: inShowcaseAssetsModel + + signal baseModelFilterConditionsMayHaveChanged() + + function setVisibilityByIndex(index, visibility) { + if (visibility === Constants.ShowcaseVisibility.NoOne) { + remove(index) + } else { + get(index).showcaseVisibility = visibility + } + } + + 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)) + } + } + StatusScrollView { // wrapped in a ScrollView on purpose; to simulate SettingsContentBase.qml SplitView.fillWidth: true SplitView.preferredHeight: 500 @@ -91,6 +127,7 @@ SplitView { id: showcasePanel width: 500 baseModel: assetsModel + showcaseModel: inShowcaseAssetsModel } } diff --git a/storybook/pages/ProfileShowcaseCollectiblesPanelPage.qml b/storybook/pages/ProfileShowcaseCollectiblesPanelPage.qml index 553a14ed1c..2876a9d825 100644 --- a/storybook/pages/ProfileShowcaseCollectiblesPanelPage.qml +++ b/storybook/pages/ProfileShowcaseCollectiblesPanelPage.qml @@ -28,6 +28,7 @@ SplitView { ListModel { id: collectiblesModel + readonly property var data: [ { uid: "123", @@ -82,6 +83,41 @@ SplitView { Component.onCompleted: append(data) } + ListModel { + id: inShowcaseCollectiblesModel + + signal baseModelFilterConditionsMayHaveChanged() + + function setVisibilityByIndex(index, visibility) { + if (visibility === Constants.ShowcaseVisibility.NoOne) { + remove(index) + } else { + get(index).showcaseVisibility = visibility + } + } + + function setVisibility(uid, visibility) { + for (let i = 0; i < count; ++i) { + if (get(i).uid === uid) { + setVisibilityByIndex(i, visibility) + } + } + } + + function hasItemInShowcase(uid) { + for (let i = 0; i < count; ++i) { + if (get(i).uid === uid) { + return true + } + } + return false + } + + function upsertItemJson(item) { + append(JSON.parse(item)) + } + } + StatusScrollView { // wrapped in a ScrollView on purpose; to simulate SettingsContentBase.qml SplitView.fillWidth: true SplitView.preferredHeight: 500 @@ -89,6 +125,7 @@ SplitView { id: showcasePanel width: 500 baseModel: collectiblesModel + showcaseModel: inShowcaseCollectiblesModel } } diff --git a/storybook/pages/ProfileShowcaseCommunitiesPanelPage.qml b/storybook/pages/ProfileShowcaseCommunitiesPanelPage.qml index 92a61e4ed0..485c2175cc 100644 --- a/storybook/pages/ProfileShowcaseCommunitiesPanelPage.qml +++ b/storybook/pages/ProfileShowcaseCommunitiesPanelPage.qml @@ -28,6 +28,7 @@ SplitView { ListModel { id: communitiesModel + Component.onCompleted: append([{ id: "0x0001", @@ -77,6 +78,41 @@ SplitView { ]) } + ListModel { + id: inShowcaseCommunitiesModel + + signal baseModelFilterConditionsMayHaveChanged() + + function setVisibilityByIndex(index, visibility) { + if (visibility === Constants.ShowcaseVisibility.NoOne) { + remove(index) + } else { + get(index).showcaseVisibility = visibility + } + } + + function setVisibility(id, visibility) { + for (let i = 0; i < count; ++i) { + if (get(i).id === id) { + setVisibilityByIndex(i, visibility) + } + } + } + + function hasItemInShowcase(id) { + for (let i = 0; i < count; ++i) { + if (get(i).id === id) { + return true + } + } + return false + } + + function upsertItemJson(item) { + append(JSON.parse(item)) + } + } + StatusScrollView { // wrapped in a ScrollView on purpose; to simulate SettingsContentBase.qml SplitView.fillWidth: true SplitView.preferredHeight: 500 @@ -84,6 +120,7 @@ SplitView { id: showcasePanel width: 500 baseModel: communitiesModel + showcaseModel: inShowcaseCommunitiesModel } }