status-desktop/ui/app/AppLayouts/Chat/CommunityComponents/InviteFriendsToCommunityPop...

76 lines
2.2 KiB
QML
Raw Normal View History

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
property string communityId: chatsModel.communities.activeCommunity.id
2020-12-11 20:38:10 +00:00
property var goBack
onOpened: {
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
height: 630
CommunityProfilePopupInviteFriendsView {
id: contactFieldAndList
2020-12-11 20:38:10 +00:00
anchors.fill: parent
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
}
contactFieldAndList.sendInvites([pubKey])
2020-12-11 20:38:10 +00:00
}
}
footer: Item {
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
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 : {
contactFieldAndList.sendInvites(contactFieldAndList.contactListSearch.pubKeys)
2020-12-11 20:38:10 +00:00
}
}
}
}