2023-03-20 12:29:05 +00:00
|
|
|
|
import QtQuick 2.15
|
2024-02-12 16:56:59 +00:00
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
import StatusQ.Controls 0.1
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
|
|
import utils 1.0
|
2024-02-12 16:56:59 +00:00
|
|
|
|
import shared.panels 1.0
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
|
|
import AppLayouts.Profile.controls 1.0
|
|
|
|
|
|
|
|
|
|
ProfileShowcasePanel {
|
|
|
|
|
id: root
|
|
|
|
|
|
2024-02-12 16:56:59 +00:00
|
|
|
|
required property bool addAccountsButtonVisible
|
|
|
|
|
|
|
|
|
|
signal navigateToAccountsTab()
|
|
|
|
|
|
2023-07-17 23:56:40 +00:00
|
|
|
|
keyRole: "uid"
|
2024-01-25 17:43:36 +00:00
|
|
|
|
roleNames: ["uid", "chainId", "tokenId", "contractAddress", "communityId", "name", "collectionName", "backgroundColor", "imageUrl"].concat(showcaseRoles)
|
2023-11-01 16:54:22 +00:00
|
|
|
|
filterFunc: (modelData) => !showcaseModel.hasItemInShowcase(modelData.uid)
|
2024-02-15 17:26:05 +00:00
|
|
|
|
emptyInShowcasePlaceholderText: qsTr("Collectibles here will show on your profile")
|
|
|
|
|
emptyHiddenPlaceholderText: qsTr("Collectibles here will be hidden from your profile")
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
2024-02-15 17:26:05 +00:00
|
|
|
|
hiddenDraggableDelegateComponent: CollectibleShowcaseDelegate {
|
2023-03-20 12:29:05 +00:00
|
|
|
|
Drag.keys: ["x-status-draggable-showcase-item-hidden"]
|
|
|
|
|
showcaseObj: modelData
|
|
|
|
|
dragParent: dragParentData
|
|
|
|
|
visualIndex: visualIndexData
|
|
|
|
|
onShowcaseVisibilityRequested: {
|
|
|
|
|
var tmpObj = Object()
|
|
|
|
|
root.roleNames.forEach(role => tmpObj[role] = showcaseObj[role])
|
|
|
|
|
tmpObj.showcaseVisibility = value
|
2023-11-01 16:54:22 +00:00
|
|
|
|
showcaseModel.upsertItemJson(JSON.stringify(tmpObj))
|
|
|
|
|
root.showcaseEntryChanged()
|
2023-03-20 12:29:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
showcaseDraggableDelegateComponent: CollectibleShowcaseDelegate {
|
|
|
|
|
Drag.keys: ["x-status-draggable-showcase-item"]
|
|
|
|
|
showcaseObj: modelData
|
|
|
|
|
dragParent: dragParentData
|
|
|
|
|
visualIndex: visualIndexData
|
|
|
|
|
dragAxis: Drag.YAxis
|
|
|
|
|
showcaseVisibility: !!modelData ? modelData.showcaseVisibility : Constants.ShowcaseVisibility.NoOne
|
|
|
|
|
onShowcaseVisibilityRequested: {
|
2023-11-01 16:54:22 +00:00
|
|
|
|
showcaseModel.setVisibility(showcaseObj.uid, value)
|
|
|
|
|
root.showcaseEntryChanged()
|
2023-03-20 12:29:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-21 13:39:27 +00:00
|
|
|
|
additionalFooterComponent: root.addAccountsButtonVisible ? addMoreAccountsComponent : null
|
2024-02-12 16:56:59 +00:00
|
|
|
|
|
2024-02-21 13:39:27 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: addMoreAccountsComponent
|
2024-02-12 16:56:59 +00:00
|
|
|
|
|
2024-02-21 13:39:27 +00:00
|
|
|
|
AddMoreAccountsLink {
|
|
|
|
|
visible: root.addAccountsButtonVisible
|
|
|
|
|
text: qsTr("Don’t see some of your collectibles?")
|
|
|
|
|
onClicked: root.navigateToAccountsTab()
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-20 12:29:05 +00:00
|
|
|
|
}
|