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.access = chatsModel.communities.activeCommunity.access;
communityProfilePopup.nbMembers = chatsModel.communities.activeCommunity.nbMembers; communityProfilePopup.nbMembers = chatsModel.communities.activeCommunity.nbMembers;
communityProfilePopup.isAdmin = chatsModel.communities.activeCommunity.admin communityProfilePopup.isAdmin = chatsModel.communities.activeCommunity.admin
communityProfilePopup.source = chatsModel.communities.activeCommunity.thumbnailImage
communityProfilePopup.communityColor = chatsModel.communities.activeCommunity.communityColor
communityProfilePopup.open(); communityProfilePopup.open();
} }
hoverEnabled: true hoverEnabled: true

View File

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

View File

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