mirror of https://github.com/status-im/StatusQ.git
feat(StatusSearchPopup): add function hook to allow timestamp formatting
This introduces a new API to allow users to provide a function that formats timestamps in the search results. ```qml StatusSearchPopup { formatTimestampFn: function (ts) { return // formatted ts } } ``` Closes #363
This commit is contained in:
parent
0a4d3860ea
commit
b45aba4be8
|
@ -28,6 +28,10 @@ StatusModal {
|
|||
signal resultItemClicked(string itemId)
|
||||
signal resultItemTitleClicked(string titleId)
|
||||
|
||||
property var formatTimestampFn: function (ts) {
|
||||
return ts
|
||||
}
|
||||
|
||||
function setSearchSelection(text = "",
|
||||
secondaryText = "",
|
||||
imageSource = "",
|
||||
|
@ -291,7 +295,7 @@ StatusModal {
|
|||
statusListItemSubTitle.color: Theme.palette.black
|
||||
icon.isLetterIdenticon: (model.image === "")
|
||||
icon.background.color: model.color
|
||||
titleAsideText: model.time
|
||||
titleAsideText: root.formatTimestampFn(model.time)
|
||||
image.source: model.image
|
||||
badge.primaryText: model.badgePrimaryText
|
||||
badge.secondaryText: model.badgeSecondaryText
|
||||
|
|
Loading…
Reference in New Issue