fix(Communities): render community image in profile popup

This commit is contained in:
Pascal Precht 2021-03-16 13:39:09 +01:00 committed by Iuri Matias
parent 79338f76be
commit 8ad9e52abf
3 changed files with 29 additions and 6 deletions

View File

@ -63,6 +63,9 @@ Button {
communityProfilePopup.access = chatsModel.communities.activeCommunity.access;
communityProfilePopup.nbMembers = chatsModel.communities.activeCommunity.nbMembers;
communityProfilePopup.isAdmin = chatsModel.communities.activeCommunity.admin
communityProfilePopup.source = chatsModel.communities.activeCommunity.thumbnailImage
communityProfilePopup.communityColor = chatsModel.communities.activeCommunity.communityColor
communityProfilePopup.open();
}
hoverEnabled: true

View File

@ -13,8 +13,8 @@ ModalPopup {
property string name: community.name
property string description: community.description
property int access: community.access
// TODO get the real image once it's available
property string source: "../../../img/ens-header-dark@2x.png"
property string source: ""
property string communityColor: ""
property int nbMembers: community.nbMembers
property bool isAdmin: false
height: (isAdmin ? 600 : 590) + descriptionText.height
@ -25,12 +25,30 @@ ModalPopup {
height: childrenRect.height
width: parent.width
RoundedImage {
Loader {
id: communityImg
sourceComponent: !!popup.source ? commmunityImgCmp : letterIdenticonCmp
}
Component {
id: commmunityImgCmp
RoundedImage {
source: popup.source
width: 40
height: 40
}
}
Component {
id: letterIdenticonCmp
StatusLetterIdenticon {
width: 40
height: 40
chatName: popup.name
color: popup.communityColor
}
}
StyledTextEdit {
id: communityName

View File

@ -95,6 +95,8 @@ Rectangle {
communityProfilePopup.access = chatsModel.communities.activeCommunity.access;
communityProfilePopup.nbMembers = chatsModel.communities.activeCommunity.nbMembers;
communityProfilePopup.isAdmin = chatsModel.communities.activeCommunity.admin;
communityProfilePopup.source = chatsModel.communities.activeCommunity.thumbnailImage
communityProfilePopup.communityColor = chatsModel.communities.activeCommunity.communityColor
communityProfilePopup.open()
}
}