From 1be169bc7e52ed6f81429b40acc1014c01e9c5bd Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 23 Jul 2021 12:01:26 +0200 Subject: [PATCH] fix(@desktop/chat): remove add to contact banner from top bar fixes #2717 --- ui/app/AppLayouts/Chat/ChatColumn.qml | 6 --- .../ChatComponents/AddToContactBanner.qml | 54 ------------------- ui/nim-status-client.pro | 1 - 3 files changed, 61 deletions(-) delete mode 100644 ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/AddToContactBanner.qml diff --git a/ui/app/AppLayouts/Chat/ChatColumn.qml b/ui/app/AppLayouts/Chat/ChatColumn.qml index 5c06aaec9f..26f91dbf70 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn.qml @@ -33,7 +33,6 @@ Item { property bool isConnected: false property string contactToRemove: "" property bool showUsers: false - property var doNotShowAddToContactBannerToThose: ([]) property string activeChatId: chatsModel.channelView.activeChannel.id property bool isBlocked: profileModel.contacts.isContactBlocked(activeChatId) property bool isContact: profileModel.contacts.isAdded(activeChatId) @@ -295,11 +294,6 @@ Item { } } - AddToContactBanner { - Layout.alignment: Qt.AlignTop - Layout.fillWidth: true - } - StackLayout { id: stackLayoutChatMessages Layout.fillWidth: true diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/AddToContactBanner.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/AddToContactBanner.qml deleted file mode 100644 index 732a3e9ed9..0000000000 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/AddToContactBanner.qml +++ /dev/null @@ -1,54 +0,0 @@ -import QtQuick 2.13 -import QtGraphicalEffects 1.13 -import "../../../../../imports" -import "../../../../../shared" -import "../../../../../shared/status" - -Item { - visible: chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne && - !isContact && - !doNotShowAddToContactBannerToThose.includes(activeChatId) - height: 36 - - SVGImage { - source: "../../../../img/plusSign.svg" - anchors.right: addToContactsTxt.left - anchors.rightMargin: Style.current.smallPadding - anchors.verticalCenter: parent.verticalCenter - layer.enabled: true - layer.effect: ColorOverlay { color: addToContactsTxt.color } - } - - StyledText { - id: addToContactsTxt - //% "Add to contacts" - text: qsTrId("add-to-contacts") - color: Style.current.primary - anchors.centerIn: parent - } - - Separator { - anchors.bottom: parent.bottom - } - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onClicked: profileModel.contacts.addContact(activeChatId) - } - - StatusIconButton { - id: closeBtn - icon.name: "close" - onClicked: { - const newArray = Object.assign([], doNotShowAddToContactBannerToThose) - newArray.push(activeChatId) - doNotShowAddToContactBannerToThose = newArray - } - width: 20 - height: 20 - anchors.right: parent.right - anchors.rightMargin: Style.current.halfPadding - anchors.verticalCenter: parent.verticalCenter - } -} diff --git a/ui/nim-status-client.pro b/ui/nim-status-client.pro index abf9c135ca..c128d97cbd 100644 --- a/ui/nim-status-client.pro +++ b/ui/nim-status-client.pro @@ -101,7 +101,6 @@ DISTFILES += \ app/AppLayouts/Chat/ChatColumn/ChatComponents/ActivityCenterMessageComponent.qml \ app/AppLayouts/Chat/ChatColumn/ChatComponents/ActivityCenterTopBar.qml \ app/AppLayouts/Chat/ChatColumn/ChatComponents/ActivityChannelBadge.qml \ - app/AppLayouts/Chat/ChatColumn/ChatComponents/AddToContactBanner.qml \ app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandButton.qml \ app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandModal.qml \ app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandsPopup.qml \