feat(community): add emoji for channel header and identifier as well

This commit is contained in:
Jonathan Rainville 2022-03-14 15:32:52 -04:00
parent 4b91888433
commit 43e58e357c
6 changed files with 16 additions and 3 deletions

@ -1 +1 @@
Subproject commit 93f9214aaddb8f04be093ecd882e81d848d95b2f Subproject commit b6c3231e307cfb20fbf2d4afc228619afdfd41cb

View File

@ -89,6 +89,8 @@ QtObject {
property string currentCurrency: walletSection.currentCurrency property string currentCurrency: walletSection.currentCurrency
property string signingPhrase: walletSection.signingPhrase property string signingPhrase: walletSection.signingPhrase
property string channelEmoji: chatCommunitySectionModule && chatCommunitySectionModule.emoji
property string gasPrice: profileSectionModule.ensUsernamesModule.gasPrice property string gasPrice: profileSectionModule.ensUsernamesModule.gasPrice
property ListModel addToGroupContacts: ListModel {} property ListModel addToGroupContacts: ListModel {}

View File

@ -95,6 +95,8 @@ ColumnLayout {
chatInfoButton.image.source: chatContentModule? chatContentModule.chatDetails.icon : "" chatInfoButton.image.source: chatContentModule? chatContentModule.chatDetails.icon : ""
chatInfoButton.image.isIdenticon: chatContentModule? chatContentModule.chatDetails.isIdenticon : false chatInfoButton.image.isIdenticon: chatContentModule? chatContentModule.chatDetails.isIdenticon : false
chatInfoButton.icon.color: chatContentModule? chatContentModule.chatDetails.color : "" chatInfoButton.icon.color: chatContentModule? chatContentModule.chatDetails.color : ""
chatInfoButton.icon.emoji: chatContentModule? chatContentModule.chatDetails.emoji : ""
chatInfoButton.icon.emojiSize: "24x24"
chatInfoButton.type: chatContentModule? chatContentModule.chatDetails.type : Constants.chatType.unknown chatInfoButton.type: chatContentModule? chatContentModule.chatDetails.type : Constants.chatType.unknown
chatInfoButton.pinnedMessagesCount: chatContentModule? chatContentModule.pinnedMessagesModel.count : 0 chatInfoButton.pinnedMessagesCount: chatContentModule? chatContentModule.pinnedMessagesModel.count : 0
chatInfoButton.muted: chatContentModule? chatContentModule.chatDetails.muted : false chatInfoButton.muted: chatContentModule? chatContentModule.chatDetails.muted : false
@ -384,6 +386,7 @@ ColumnLayout {
usersStore: chatContentRoot.usersStore usersStore: chatContentRoot.usersStore
stickersLoaded: chatContentRoot.stickersLoaded stickersLoaded: chatContentRoot.stickersLoaded
isChatBlocked: chatContentRoot.isBlocked isChatBlocked: chatContentRoot.isBlocked
channelEmoji: chatContentModule.chatDetails.emoji || ""
onShowReplyArea: { onShowReplyArea: {
let obj = messageStore.getMessageByIdAsJson(messageId) let obj = messageStore.getMessageByIdAsJson(messageId)
if (!obj) { if (!obj) {

View File

@ -25,6 +25,7 @@ Item {
property var messageStore property var messageStore
property var usersStore property var usersStore
property var contactsStore property var contactsStore
property string channelEmoji
property bool stickersLoaded: false property bool stickersLoaded: false
property alias chatLogView: chatLogView property alias chatLogView: chatLogView
@ -244,6 +245,7 @@ Item {
messageStore: root.messageStore messageStore: root.messageStore
usersStore: root.usersStore usersStore: root.usersStore
contactsStore: root.contactsStore contactsStore: root.contactsStore
channelEmoji: root.channelEmoji
isChatBlocked: root.isChatBlocked isChatBlocked: root.isChatBlocked
messageContextMenu: messageContextMenuInst messageContextMenu: messageContextMenuInst

View File

@ -2,6 +2,7 @@ import QtQuick 2.14
import shared 1.0 import shared 1.0
import shared.panels 1.0 import shared.panels 1.0
import StatusQ.Core.Utils 0.1 as StatusQUtils
import utils 1.0 import utils 1.0
Column { Column {
@ -15,6 +16,7 @@ Column {
property string chatName: "" property string chatName: ""
property int chatType: -1 property int chatType: -1
property string chatColor: "" property string chatColor: ""
property string chatEmoji: ""
property string chatIcon: "" property string chatIcon: ""
property bool chatIconIsIdenticon: true property bool chatIconIsIdenticon: true
property bool didIJoinedChat: true property bool didIJoinedChat: true
@ -45,8 +47,10 @@ Column {
StyledText { StyledText {
visible: root.chatType !== Constants.chatType.oneToOne visible: root.chatType !== Constants.chatType.oneToOne
text: root.chatName.charAt(0).toUpperCase() text: root.chatEmoji ?
opacity: 0.7 StatusQUtils.Emoji.parse(root.chatEmoji, StatusQUtils.Emoji.size.veryBig) :
root.chatName.charAt(0).toUpperCase()
opacity: root.chatEmoji ? 1 : 0.7
font.weight: Font.Bold font.weight: Font.Bold
font.pixelSize: 51 font.pixelSize: 51
color: Style.current.white color: Style.current.white

View File

@ -22,6 +22,7 @@ Column {
property var usersStore property var usersStore
property var contactsStore property var contactsStore
property var messageContextMenu property var messageContextMenu
property string channelEmoji
// Once we redo qml we will know all section/chat related details in each message form the parent components // Once we redo qml we will know all section/chat related details in each message form the parent components
// without an explicit need to fetch those details via message store/module. // without an explicit need to fetch those details via message store/module.
@ -293,6 +294,7 @@ Column {
chatName: root.senderDisplayName chatName: root.senderDisplayName
chatType: root.messageStore.getChatType() chatType: root.messageStore.getChatType()
chatColor: root.messageStore.getChatColor() chatColor: root.messageStore.getChatColor()
chatEmoji: root.channelEmoji
amIChatAdmin: root.messageStore.amIChatAdmin() amIChatAdmin: root.messageStore.amIChatAdmin()
chatIcon: root.senderIcon chatIcon: root.senderIcon
chatIconIsIdenticon: root.isSenderIconIdenticon chatIconIsIdenticon: root.isSenderIconIdenticon