mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
01095e0208
- Modified `ProfileShowcasePanel` with 2 foldable sections. - Modified api of `ProfileShowcaseCommunitiesPanel` with the new base component. - Modified api of `ProfileShowcaseAccountsPanel` with the new base component. - Modified api of `ProfileShowcaseAssetsPanel` and `ProfileShowcaseCollectiblesPanel` with the new base component. - Added needed `storybook` support. Closes of #13504
42 lines
1.6 KiB
QML
42 lines
1.6 KiB
QML
import QtQuick 2.15
|
|
|
|
import utils 1.0
|
|
|
|
import AppLayouts.Profile.controls 1.0
|
|
|
|
ProfileShowcasePanel {
|
|
id: root
|
|
|
|
keyRole: "id"
|
|
roleNames: ["id", "name", "memberRole", "image", "color"].concat(showcaseRoles)
|
|
filterFunc: (modelData) => modelData.joined && !root.showcaseModel.hasItemInShowcase(modelData.id)
|
|
emptyInShowcasePlaceholderText: qsTr("Drag communities here to display in showcase")
|
|
emptyHiddenPlaceholderText: qsTr("Communities here will be hidden from your Profile")
|
|
|
|
hiddenDraggableDelegateComponent: CommunityShowcaseDelegate {
|
|
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
|
|
root.showcaseModel.upsertItemJson(JSON.stringify(tmpObj))
|
|
root.showcaseEntryChanged()
|
|
}
|
|
}
|
|
showcaseDraggableDelegateComponent: CommunityShowcaseDelegate {
|
|
Drag.keys: ["x-status-draggable-showcase-item"]
|
|
showcaseObj: modelData
|
|
dragParent: dragParentData
|
|
visualIndex: visualIndexData
|
|
dragAxis: Drag.YAxis
|
|
showcaseVisibility: !!modelData ? modelData.showcaseVisibility : Constants.ShowcaseVisibility.NoOne
|
|
onShowcaseVisibilityRequested: {
|
|
root.showcaseModel.setVisibility(showcaseObj.id, value)
|
|
root.showcaseEntryChanged()
|
|
}
|
|
}
|
|
}
|