2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2022-07-25 15:07:19 +00:00
|
|
|
|
2024-08-27 14:35:52 +00:00
|
|
|
import StatusQ 0.1
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-07-25 15:07:19 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
2022-07-25 15:07:19 +00:00
|
|
|
import shared.controls 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.panels 1.0
|
2022-07-25 15:07:19 +00:00
|
|
|
import shared.views 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.status 1.0
|
2021-07-15 11:15:56 +00:00
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
import AppLayouts.stores 1.0 as AppLayoutStores
|
|
|
|
import AppLayouts.Profile.stores 1.0 as ProfileStores
|
|
|
|
|
2022-07-25 15:07:19 +00:00
|
|
|
ColumnLayout {
|
2021-04-20 12:31:36 +00:00
|
|
|
id: root
|
2022-10-25 18:39:21 +00:00
|
|
|
objectName: "CommunityProfilePopupInviteFrindsPanel_ColumnLayout"
|
2021-04-20 12:31:36 +00:00
|
|
|
|
|
|
|
property string headerTitle: ""
|
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
property AppLayoutStores.RootStore rootStore
|
|
|
|
property ProfileStores.ContactsStore contactsStore
|
2021-07-16 12:36:27 +00:00
|
|
|
property var community
|
2021-04-20 12:31:36 +00:00
|
|
|
|
2022-07-25 15:07:19 +00:00
|
|
|
property var pubKeys: ([])
|
2021-07-15 11:15:56 +00:00
|
|
|
|
2022-10-07 14:40:23 +00:00
|
|
|
spacing: 0
|
2021-08-04 12:34:06 +00:00
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: headline
|
|
|
|
text: qsTr("Contacts")
|
2024-10-15 19:26:12 +00:00
|
|
|
font.pixelSize: Theme.primaryTextFontSize
|
|
|
|
color: Theme.palette.secondaryText
|
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2021-04-20 12:31:36 +00:00
|
|
|
}
|
|
|
|
|
2023-04-19 16:48:57 +00:00
|
|
|
SearchBox {
|
2022-07-25 15:07:19 +00:00
|
|
|
id: filterInput
|
|
|
|
placeholderText: qsTr("Search contacts")
|
2022-10-07 14:40:23 +00:00
|
|
|
maximumHeight: 36
|
|
|
|
topPadding: 0
|
|
|
|
bottomPadding: 0
|
2022-07-25 15:07:19 +00:00
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.bigPadding
|
|
|
|
Layout.bottomMargin: Theme.padding
|
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2022-07-25 15:07:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ExistingContacts {
|
|
|
|
id: existingContacts
|
|
|
|
|
2022-09-16 08:30:08 +00:00
|
|
|
rootStore: root.rootStore
|
2022-01-10 16:44:54 +00:00
|
|
|
contactsStore: root.contactsStore
|
2022-09-16 08:30:08 +00:00
|
|
|
communityId: root.community.id
|
|
|
|
|
2021-05-17 09:56:55 +00:00
|
|
|
hideCommunityMembers: true
|
2022-07-25 15:07:19 +00:00
|
|
|
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.fillWidth: true
|
2022-10-07 14:40:23 +00:00
|
|
|
Layout.fillHeight: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.halfPadding
|
|
|
|
Layout.rightMargin: Theme.halfPadding
|
2022-07-25 15:07:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusModalDivider {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusDescriptionListItem {
|
2023-03-14 19:20:25 +00:00
|
|
|
Layout.fillWidth: true
|
2022-07-25 15:07:19 +00:00
|
|
|
title: qsTr("Share community")
|
2023-03-14 19:20:25 +00:00
|
|
|
subTitle: Utils.getCommunityShareLink(root.community.id)
|
2022-07-25 15:07:19 +00:00
|
|
|
tooltip.text: qsTr("Copied!")
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.name: "copy"
|
2022-07-25 15:07:19 +00:00
|
|
|
iconButton.onClicked: {
|
2022-10-26 14:08:59 +00:00
|
|
|
let link = Utils.getCommunityShareLink(root.community.id)
|
2024-08-27 14:35:52 +00:00
|
|
|
ClipboardUtils.setText(link)
|
2022-07-25 15:07:19 +00:00
|
|
|
tooltip.visible = !tooltip.visible
|
|
|
|
}
|
2021-04-20 12:31:36 +00:00
|
|
|
}
|
|
|
|
}
|