feat(act-center): hide viewed notifications when clicking the hide btn

This commit is contained in:
Jonathan Rainville 2021-06-10 11:15:38 -04:00
parent d5032430f9
commit e27c66d8af
3 changed files with 17 additions and 8 deletions

View File

@ -20,6 +20,8 @@ Popup {
property bool hasReplies: false
property bool hasContactRequests: contactList.count > 0
property bool hideReadNotifications: false
id: activityCenter
modal: true
@ -75,7 +77,8 @@ Popup {
model: profileModel.contacts.contactRequests
delegate: ContactRequest {
visible: activityCenter.currentFilter === ActivityCenter.Filter.All || activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests
visible: !hideReadNotifications &&
(activityCenter.currentFilter === ActivityCenter.Filter.All || activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests)
name: Utils.removeStatusEns(model.name)
address: model.address
localNickname: model.localNickname
@ -150,9 +153,15 @@ Popup {
id: messageNotificationComponent
Rectangle {
visible: activityCenter.currentFilter === ActivityCenter.Filter.All ||
(model.notificationType === Constants.acitivtyCenterNotificationTypeMention && activityCenter.currentFilter === ActivityCenter.Filter.Mentions) ||
(model.notificationType === Constants.acitivtyCenterNotificationTypeReply && activityCenter.currentFilter === ActivityCenter.Filter.Replies)
visible: {
if (hideReadNotifications && model.read) {
return false
}
return activityCenter.currentFilter === ActivityCenter.Filter.All ||
(model.notificationType === Constants.acitivtyCenterNotificationTypeMention && activityCenter.currentFilter === ActivityCenter.Filter.Mentions) ||
(model.notificationType === Constants.acitivtyCenterNotificationTypeReply && activityCenter.currentFilter === ActivityCenter.Filter.Replies)
}
width: parent.width
height: childrenRect.height + Style.current.smallPadding
color: model.read ? Style.current.transparent : Utils.setColorAlpha(Style.current.blue, 0.1)

View File

@ -94,11 +94,11 @@ Item {
y: moreActionsBtn.height + 4
Action {
icon.source: "../../../../img/eye-barred.svg"
icon.source: hideReadNotifications ? "../../../../img/eye.svg" : "../../../../img/eye-barred.svg"
icon.width: 16
icon.height: 16
text: qsTr("Hide read notifications")
onTriggered: console.log('TODO Change settings')
text: hideReadNotifications ? qsTr("Show read notifications") : qsTr("Hide read notifications")
onTriggered: hideReadNotifications = !hideReadNotifications
}
Action {
icon.source: "../../../../img/bell.svg"

2
vendor/status-go vendored

@ -1 +1 @@
Subproject commit f2678ea9506ea4ff5f380a16a9ee329313f35630
Subproject commit 43fa2edc1e6e0afa65724d47a95d47cd28c21d85