Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CreateChatView): hide the Contacts label when no contacts #6384

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Chat/panels/GroupChatPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ RowLayout {
id: confirmButton
implicitHeight: 44
Layout.alignment: Qt.AlignTop
text: "Confirm"
text: qsTr("Confirm")
onClicked: {
if(root.chatContentModule.chatDetails.id &&((d.addedMembersIds.length > 0) || (d.removedMembersIds.length > 0))) {
// Add request:
Expand Down
19 changes: 7 additions & 12 deletions ui/app/AppLayouts/Chat/views/CreateChatView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ Page {
// TODO: Could it be replaced to `GroupChatPanel`?
header: RowLayout {
id: headerRow
width: parent.width
height: tagSelector.height
anchors.top: parent.top
anchors.topMargin: 8
clip: true
StatusTagSelector {
Expand All @@ -93,7 +91,8 @@ Page {
Layout.leftMargin: 17
maxHeight: root.height
nameCountLimit: 20
listLabel: qsTr("Contacts")
listLabel: contactsModel.count ? qsTr("Contacts") : ""
textEdit.enabled: contactsModel.count
toLabelText: qsTr("To: ")
warningText: qsTr("USER LIMIT REACHED")
ringSpecModelGetter: function(pubKey) {
Expand All @@ -114,8 +113,8 @@ Page {
id: confirmButton
implicitHeight: 44
Layout.alignment: Qt.AlignTop
enabled: (tagSelector.namesModel.count > 0)
text: "Confirm"
enabled: tagSelector.namesModel.count > 0
text: qsTr("Confirm")
onClicked: {
root.rootStore.createChatInitMessage = chatInput.textInput.text;
root.rootStore.createChatFileUrls = chatInput.fileUrls;
Expand All @@ -138,9 +137,6 @@ Page {
}

contentItem: Item {
anchors.fill: parent
anchors.topMargin: headerRow.height + 32

StatusChatInput {
id: chatInput
anchors.bottom: parent.bottom
Expand Down Expand Up @@ -178,17 +174,16 @@ Page {
}

StatusBaseText {
width: parent.width
height: contentHeight
width: parent.width*.66
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
visible: (contactsModel.count === 0)
visible: contactsModel.count === 0
wrapMode: Text.WordWrap
font.pixelSize: 15
color: Theme.palette.baseColor1
text: qsTr("You can only send direct messages to your Contacts.\n\n
Send a contact request to the person you would like to chat with, you will be able to
Send a contact request to the person you would like to chat with, you will be able to \
chat with them once they have accepted your contact request.")
Component.onCompleted: {
if (visible) {
Expand Down