2023-03-20 13:29:05 +01:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
2024-03-03 17:34:08 +01:00
|
|
|
import StatusQ 0.1
|
2023-03-20 13:29:05 +01:00
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import AppLayouts.Profile.controls 1.0
|
|
|
|
|
|
|
|
ProfileShowcasePanel {
|
|
|
|
id: root
|
|
|
|
|
2024-02-15 18:26:05 +01:00
|
|
|
emptyInShowcasePlaceholderText: qsTr("Drag communities here to display in showcase")
|
|
|
|
emptyHiddenPlaceholderText: qsTr("Communities here will be hidden from your Profile")
|
2024-03-03 17:34:08 +01:00
|
|
|
emptySearchPlaceholderText: qsTr("No communities matching search")
|
|
|
|
searchPlaceholderText: qsTr("Search community name or role")
|
2024-02-29 11:07:35 +02:00
|
|
|
delegate: ProfileShowcasePanelDelegate {
|
2024-02-28 14:19:14 +02:00
|
|
|
title: model ? model.name : ""
|
2024-03-03 17:34:08 +01:00
|
|
|
secondaryTitle: (model && model.memberRole) ? ProfileUtils.getMemberRoleText(model.memberRole) : qsTr("Member")
|
2024-02-28 14:19:14 +02:00
|
|
|
hasImage: model && !!model.image
|
|
|
|
|
|
|
|
icon.name: model ? model.name : ""
|
|
|
|
icon.source: model ? model.image : ""
|
|
|
|
icon.color: model ? model.color : ""
|
2023-03-20 13:29:05 +01:00
|
|
|
}
|
2024-04-19 12:46:23 +03:00
|
|
|
|
|
|
|
filter: FastExpressionFilter {
|
|
|
|
readonly property string lowerCaseSearchText: root.searcherText.toLowerCase()
|
|
|
|
|
|
|
|
function getMemberRole(memberRole) {
|
|
|
|
return ProfileUtils.getMemberRoleText(memberRole)
|
|
|
|
}
|
|
|
|
|
|
|
|
expression: {
|
|
|
|
lowerCaseSearchText
|
|
|
|
return (name.toLowerCase().includes(lowerCaseSearchText) ||
|
|
|
|
getMemberRole(memberRole).toLowerCase().includes(lowerCaseSearchText))
|
|
|
|
}
|
|
|
|
expectedRoles: ["name", "memberRole"]
|
|
|
|
}
|
2023-03-20 13:29:05 +01:00
|
|
|
}
|