-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(desktop): New invite to community popup with message
- Loading branch information
1 parent
0418979
commit e67d649
Showing
25 changed files
with
287 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 58 additions & 34 deletions
92
ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupInviteFriendsPanel.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,86 @@ | ||
import QtQuick 2.12 | ||
import QtQuick.Controls 2.12 | ||
import QtQuick.Dialogs 1.3 | ||
import QtQuick.Layouts 1.13 | ||
import QtGraphicalEffects 1.13 | ||
import QtQuick 2.14 | ||
import QtQuick.Layouts 1.4 | ||
|
||
import StatusQ.Components 0.1 | ||
import StatusQ.Controls 0.1 | ||
import StatusQ.Popups 0.1 | ||
|
||
import utils 1.0 | ||
import shared.controls 1.0 | ||
import shared 1.0 | ||
import shared.controls 1.0 | ||
import shared.panels 1.0 | ||
import shared.views 1.0 | ||
import shared.status 1.0 | ||
import StatusQ.Components 0.1 | ||
import StatusQ.Popups 0.1 | ||
|
||
Column { | ||
ColumnLayout { | ||
id: root | ||
|
||
property string headerTitle: "" | ||
|
||
property var rootStore | ||
property var contactsStore | ||
property var community | ||
property alias contactListSearch: contactFieldAndList | ||
|
||
StatusDescriptionListItem { | ||
title: qsTr("Share community") | ||
subTitle: `${Constants.communityLinkPrefix}${root.community && root.community.id.substring(0, 4)}...${root.community && root.community.id.substring(root.community.id.length -2)}` | ||
tooltip.text: qsTr("Copied!") | ||
icon.name: "copy" | ||
iconButton.onClicked: { | ||
let link = `${Constants.communityLinkPrefix}${root.community.id}` | ||
root.rootStore.copyToClipboard(link) | ||
tooltip.visible = !tooltip.visible | ||
} | ||
width: parent.width | ||
} | ||
property var pubKeys: ([]) | ||
|
||
StatusModalDivider { | ||
bottomPadding: Style.current.padding | ||
} | ||
spacing: Style.current.padding | ||
|
||
StyledText { | ||
id: headline | ||
text: qsTr("Contacts") | ||
font.pixelSize: Style.current.primaryTextFontSize | ||
color: Style.current.secondaryText | ||
anchors.left: parent.left | ||
anchors.leftMargin: Style.current.padding | ||
} | ||
|
||
ContactsListAndSearch { | ||
id: contactFieldAndList | ||
anchors.horizontalCenter: parent.horizontalCenter | ||
width: parent.width - 32 | ||
StatusInput { | ||
id: filterInput | ||
placeholderText: qsTr("Search contacts") | ||
input.icon.name: "search" | ||
input.clearable: true | ||
Layout.fillWidth: true | ||
} | ||
|
||
ExistingContacts { | ||
id: existingContacts | ||
|
||
contactsStore: root.contactsStore | ||
community: root.community | ||
showCheckbox: true | ||
hideCommunityMembers: true | ||
showSearch: false | ||
rootStore: root.rootStore | ||
showCheckbox: true | ||
filterText: filterInput.text | ||
pubKeys: root.pubKeys | ||
onContactClicked: function (contact) { | ||
if (!contact || typeof contact === "string") { | ||
return | ||
} | ||
const index = root.pubKeys.indexOf(contact.pubKey) | ||
const pubKeysCopy = Object.assign([], root.pubKeys) | ||
if (index === -1) { | ||
pubKeysCopy.push(contact.pubKey) | ||
} else { | ||
pubKeysCopy.splice(index, 1) | ||
} | ||
root.pubKeys = pubKeysCopy | ||
} | ||
Layout.rightMargin: -Style.current.padding | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
} | ||
|
||
StatusModalDivider { | ||
bottomPadding: Style.current.padding | ||
Layout.fillWidth: true | ||
} | ||
|
||
StatusDescriptionListItem { | ||
title: qsTr("Share community") | ||
subTitle: `${Constants.communityLinkPrefix}${root.community && root.community.id.substring(0, 4)}...${root.community && root.community.id.substring(root.community.id.length -2)}` | ||
tooltip.text: qsTr("Copied!") | ||
icon.name: "copy" | ||
iconButton.onClicked: { | ||
let link = `${Constants.communityLinkPrefix}${root.community.id}` | ||
root.rootStore.copyToClipboard(link) | ||
tooltip.visible = !tooltip.visible | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
ui/app/AppLayouts/Chat/panels/communities/CommunityProfilePopupInviteMessagePanel.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import QtQuick 2.14 | ||
import QtQuick.Layouts 1.4 | ||
|
||
import StatusQ.Core 0.1 | ||
import StatusQ.Components 0.1 | ||
import StatusQ.Controls 0.1 | ||
import StatusQ.Popups 0.1 | ||
|
||
import utils 1.0 | ||
import shared 1.0 | ||
import shared.views 1.0 | ||
import shared.status 1.0 | ||
|
||
ColumnLayout { | ||
id: root | ||
|
||
property var pubKeys: ([]) | ||
|
||
property var rootStore | ||
property var contactsStore | ||
|
||
property alias inviteMessage: messageInput.text | ||
|
||
spacing: Style.current.padding | ||
|
||
QtObject { | ||
id: d | ||
|
||
readonly property int maxMsgLength: 140 | ||
readonly property int msgHeight: 108 | ||
} | ||
|
||
StatusInput { | ||
id: messageInput | ||
label: qsTr("Invitation Message") | ||
charLimit: d.maxMsgLength | ||
placeholderText: qsTr("The message a contact will get with community invitation") | ||
input.multiline: true | ||
input.implicitHeight: d.msgHeight | ||
input.verticalAlignment: TextEdit.AlignTop | ||
Layout.minimumHeight: 150 // TODO: implicitHeight is not calculated well from input.implicitHeight | ||
Layout.fillWidth: true | ||
} | ||
|
||
PickedContacts { | ||
id: existingContacts | ||
enabled: false | ||
contactsStore: root.contactsStore | ||
pubKeys: root.pubKeys | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.