feat(Activity center): add contact requests rudimentary version

Fixes #2609
This commit is contained in:
Jonathan Rainville 2021-05-28 15:01:46 -04:00 committed by Iuri Matias
parent 18b26a1c67
commit c18214aca1
1 changed files with 35 additions and 20 deletions

View File

@ -49,36 +49,51 @@ Popup {
anchors.topMargin: 13 anchors.topMargin: 13
width: parent.width width: parent.width
property Component profilePopupComponent: ProfilePopup {
id: profilePopup
onClosed: destroy()
}
// TODO remove this once it is handled by the activity center
Repeater {
id: contactList
model: profileModel.contacts.contactRequests
delegate: ContactRequest {
visible: activityCenter.currentFilter === ActivityCenter.Filter.All || activityCenter.currentFilter === ActivityCenter.Filter.ContactRequests
name: Utils.removeStatusEns(model.name)
address: model.address
localNickname: model.localNickname
identicon: model.thumbnailImage || model.identicon
// TODO set to transparent bg if the notif is read
color: Utils.setColorAlpha(Style.current.blue, 0.1)
radius: 0
profileClick: function (showFooter, userName, fromAuthor, identicon, textParam, nickName) {
var popup = profilePopupComponent.createObject(contactList);
popup.openPopup(showFooter, userName, fromAuthor, identicon, textParam, nickName);
}
onBlockContactActionTriggered: {
blockContactConfirmationDialog.contactName = name
blockContactConfirmationDialog.contactAddress = address
blockContactConfirmationDialog.open()
}
}
}
StyledText { StyledText {
text: "Today" text: "Today"
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.padding anchors.leftMargin: Style.current.padding
font.pixelSize: 15 font.pixelSize: 15
bottomPadding: 4
topPadding: Style.current.halfPadding
color: Style.current.secondaryText color: Style.current.secondaryText
height: implicitHeight + 4
}
ContactRequest {
name: "@alice.eth"
address: "0x04db719bf99bee817c97cab909c682d43e1ffa58c4f24edaa0cb7e97e6779dbfd44f430d9a4777e0faa45d74bdbe70240cbea9db8e2cf9a8111374ef4f5d50ac24"
identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAb0lEQVR4Ae3UQQqAIBRF0Wj9ba9Bq6l5JBQqfn/ngDMH3YS3AAB/tO3H+XRG3b9bR/+gVoREI2RapVXpfd5+X5oXERKNkHS+rk3tOpWkeREh0QiZVu91ql2zNC8iJBoh0yqtSqt1slpCghICANDPBc0ESPh0bHkHAAAAAElFTkSuQmCC"
// TODO set to transparent bg if the notif is read
color: Utils.setColorAlpha(Style.current.blue, 0.1)
radius: 0
}
ContactRequest {
name: "@bob.eth"
address: "0x04db719bf99bee817c97cab909c682d43e1ffa58c4f24edaa0cb7e97e6779dbfd44f430d9a4777e0faa45d74bdbe70240cbea9db8e2cf9a8111374ef4f5d50ac24"
identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAjUlEQVR4nOzWwQmEUAwG4V2xF+sTLEOwPqvRBhSUEBh/5jt6eDIEQoZfCENoDKExhMYQmpiQsevhbV+Pq+/ztPw7/hczEUNoDKEpb5C77fRWdZvFTMQQGkNoHt9a3bdT9f2YiRhCY4iaxEzEEBpDaMq3Vjdvra8yhCYmJEbMRAyhMYTGEBpDaM4AAAD//8vbFGZ2G0s4AAAAAElFTkSuQmCC"
// TODO set to transparent bg if the notif is read
color: Utils.setColorAlpha(Style.current.blue, 0.1)
radius: 0
} }
Rectangle { Rectangle {
visible: activityCenter.currentFilter === ActivityCenter.Filter.All || activityCenter.currentFilter === ActivityCenter.Filter.Mentions
width: parent.width width: parent.width
height: childrenRect.height + Style.current.smallPadding height: visible ? childrenRect.height + Style.current.smallPadding : 0
color: Utils.setColorAlpha(Style.current.blue, 0.1) color: Utils.setColorAlpha(Style.current.blue, 0.1)
Message { Message {