2020-12-11 20:38:10 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQml.Models 2.3
|
|
|
|
import "../../../../imports"
|
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../shared/status"
|
|
|
|
import "./"
|
|
|
|
import "../components"
|
|
|
|
|
|
|
|
ModalPopup {
|
|
|
|
id: popup
|
|
|
|
|
2021-03-09 17:59:41 +00:00
|
|
|
property string communityId: chatsModel.communities.activeCommunity.id
|
2020-12-11 20:38:10 +00:00
|
|
|
property var goBack
|
|
|
|
|
|
|
|
onOpened: {
|
2021-04-20 12:31:36 +00:00
|
|
|
contactFieldAndList.contactListSearch.chatKey.text = ""
|
|
|
|
contactFieldAndList.contactListSearch.pubKey = ""
|
|
|
|
contactFieldAndList.contactListSearch.pubKeys = []
|
|
|
|
contactFieldAndList.contactListSearch.ensUsername = ""
|
|
|
|
contactFieldAndList.contactListSearch.chatKey.forceActiveFocus(Qt.MouseFocusReason)
|
|
|
|
contactFieldAndList.contactListSearch.existingContacts.visible = profileModel.contacts.list.hasAddedContacts()
|
|
|
|
contactFieldAndList.contactListSearch.noContactsRect.visible = !contactFieldAndList.contactListSearch.existingContacts.visible
|
2020-12-11 20:38:10 +00:00
|
|
|
}
|
|
|
|
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Invite friends"
|
|
|
|
title: qsTrId("invite-friends")
|
2020-12-11 20:38:10 +00:00
|
|
|
|
2021-03-31 19:14:09 +00:00
|
|
|
height: 630
|
|
|
|
|
2021-04-20 12:31:36 +00:00
|
|
|
CommunityProfilePopupInviteFriendsView {
|
|
|
|
id: contactFieldAndList
|
2020-12-11 20:38:10 +00:00
|
|
|
anchors.fill: parent
|
2021-04-20 12:31:36 +00:00
|
|
|
contactListSearch.onUserClicked: {
|
|
|
|
if (isContact) {
|
|
|
|
// those are just added to the list to by added by the bunch
|
|
|
|
return
|
2020-12-11 20:38:10 +00:00
|
|
|
}
|
2021-04-20 12:31:36 +00:00
|
|
|
contactFieldAndList.sendInvites([pubKey])
|
2020-12-11 20:38:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
footer: Item {
|
2021-01-13 19:15:52 +00:00
|
|
|
width: parent.width
|
|
|
|
height: inviteBtn.height
|
2020-12-11 20:38:10 +00:00
|
|
|
|
|
|
|
StatusRoundButton {
|
|
|
|
id: btnBack
|
|
|
|
anchors.left: parent.left
|
|
|
|
visible: !!popup.goBack
|
|
|
|
icon.name: "arrow-right"
|
|
|
|
icon.width: 20
|
|
|
|
icon.height: 16
|
|
|
|
rotation: 180
|
|
|
|
onClicked: {
|
|
|
|
// Go back? Make it work when it's
|
|
|
|
popup.goBack()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
id: inviteBtn
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.right: parent.right
|
2021-04-20 12:31:36 +00:00
|
|
|
enabled: contactFieldAndList.contactListSearch.pubKeys.length > 0
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Invite"
|
|
|
|
text: qsTrId("invite-button")
|
2020-12-11 20:38:10 +00:00
|
|
|
onClicked : {
|
2021-04-20 12:31:36 +00:00
|
|
|
contactFieldAndList.sendInvites(contactFieldAndList.contactListSearch.pubKeys)
|
2020-12-11 20:38:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|