mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 06:16:32 +00:00
cc83098263
* feat(Communities): Refactor token holder list item to separate file Close #11858 * feat(Communities): Use contact details for community member info * feat(Communities): reuse StatusMemberListItem for member token holder * Review fixes Co-authored-by: Michał Iskierko <61889657+endulab@users.noreply.github.com> --------- Co-authored-by: Michał Iskierko <61889657+endulab@users.noreply.github.com>
68 lines
1.8 KiB
QML
68 lines
1.8 KiB
QML
import SortFilterProxyModel 0.2
|
|
|
|
SortFilterProxyModel {
|
|
id: root
|
|
|
|
property string searchText
|
|
readonly property string searchTextLowerCase: searchText.toLowerCase()
|
|
|
|
property int sortBy: TokenHoldersProxyModel.SortBy.Username
|
|
property int sortOrder: Qt.AscendingOrder
|
|
|
|
enum SortBy {
|
|
None, Username, NumberOfMessages, Holding
|
|
}
|
|
|
|
filters: ExpressionFilter {
|
|
expression: {
|
|
root.searchTextLowerCase
|
|
|
|
const nameLowerCase = model.name.toLowerCase()
|
|
const addressLowerCase = model.walletAddress.toLowerCase()
|
|
|
|
return nameLowerCase.includes(searchTextLowerCase) ||
|
|
addressLowerCase.includes(searchTextLowerCase)
|
|
}
|
|
}
|
|
|
|
sorters: [
|
|
FilterSorter {
|
|
enabled: root.sortBy === TokenHoldersProxyModel.SortBy.Username
|
|
|
|
ValueFilter {
|
|
roleName: "name"
|
|
value: ""
|
|
inverted: true
|
|
}
|
|
|
|
priority: 3
|
|
},
|
|
|
|
RoleSorter {
|
|
enabled: root.sortBy === TokenHoldersProxyModel.SortBy.Username
|
|
roleName: "name"
|
|
sortOrder: root.sortOrder
|
|
priority: 2
|
|
},
|
|
|
|
RoleSorter {
|
|
enabled: root.sortBy === TokenHoldersProxyModel.SortBy.Username
|
|
roleName: "walletAddress"
|
|
sortOrder: root.sortOrder
|
|
priority: 1
|
|
},
|
|
|
|
RoleSorter {
|
|
enabled: root.sortBy === TokenHoldersProxyModel.SortBy.NumberOfMessages
|
|
roleName: "numberOfMessages"
|
|
sortOrder: root.sortOrder
|
|
},
|
|
|
|
RoleSorter {
|
|
enabled: root.sortBy === TokenHoldersProxyModel.SortBy.Holding
|
|
roleName: "amount"
|
|
sortOrder: root.sortOrder
|
|
}
|
|
]
|
|
}
|