2021-04-20 12:31:36 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
import QtQuick.Dialogs 1.3
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtGraphicalEffects 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-04-20 12:31:36 +00:00
|
|
|
import "../../../../shared"
|
2021-10-14 10:15:43 +00:00
|
|
|
import "../../../../shared/controls"
|
2021-04-20 12:31:36 +00:00
|
|
|
import "../../../../shared/status"
|
|
|
|
|
2021-07-15 11:15:56 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
|
|
|
Column {
|
2021-04-20 12:31:36 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property string headerTitle: ""
|
|
|
|
|
2021-07-16 12:36:27 +00:00
|
|
|
property var community
|
2021-04-20 12:31:36 +00:00
|
|
|
property alias contactListSearch: contactFieldAndList
|
|
|
|
|
|
|
|
function sendInvites(pubKeys) {
|
2021-07-16 12:36:27 +00:00
|
|
|
const error = chatsModel.communities.inviteUsersToCommunityById(root.community.id, JSON.stringify(pubKeys))
|
2021-04-20 12:31:36 +00:00
|
|
|
if (error) {
|
|
|
|
console.error('Error inviting', error)
|
|
|
|
contactFieldAndList.validationError = error
|
|
|
|
return
|
|
|
|
}
|
2021-07-16 20:22:50 +00:00
|
|
|
//% "Invite successfully sent"
|
|
|
|
contactFieldAndList.successMessage = qsTrId("invite-successfully-sent")
|
2021-04-20 12:31:36 +00:00
|
|
|
}
|
|
|
|
|
2021-07-15 11:15:56 +00:00
|
|
|
StatusDescriptionListItem {
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "Share community"
|
|
|
|
title: qsTrId("share-community")
|
2021-07-21 09:49:03 +00:00
|
|
|
subTitle: `${Constants.communityLinkPrefix}${root.community && root.community.id.substring(0, 4)}...${root.community && root.community.id.substring(root.community.id.length -2)}`
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "Copy to clipboard"
|
|
|
|
tooltip.text: qsTrId("copy-to-clipboard")
|
2021-07-15 11:15:56 +00:00
|
|
|
icon.name: "copy"
|
|
|
|
iconButton.onClicked: {
|
2021-07-16 12:36:27 +00:00
|
|
|
let link = `${Constants.communityLinkPrefix}${root.community.id}`
|
2021-07-15 11:15:56 +00:00
|
|
|
chatsModel.copyToClipboard(link)
|
|
|
|
tooltip.visible = !tooltip.visible
|
|
|
|
}
|
|
|
|
width: parent.width
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusModalDivider {
|
2021-08-04 12:34:06 +00:00
|
|
|
bottomPadding: 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
|
2021-04-20 12:31:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ContactsListAndSearch {
|
|
|
|
id: contactFieldAndList
|
2021-07-15 11:15:56 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
width: parent.width - 32
|
2021-04-20 12:31:36 +00:00
|
|
|
showCheckbox: true
|
2021-05-17 09:56:55 +00:00
|
|
|
hideCommunityMembers: true
|
2021-08-04 12:34:06 +00:00
|
|
|
showSearch: false
|
2021-04-20 12:31:36 +00:00
|
|
|
}
|
|
|
|
}
|