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

69 lines
1.9 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 StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Popups 0.1
2020-12-11 20:38:10 +00:00
import "../../../../imports"
import "../../../../shared"
import "../components"
StatusModal {
2020-12-11 20:38:10 +00:00
id: popup
property var community
2020-12-11 20:38:10 +00:00
onOpened: {
contentComponent.community = community
contentComponent.contactListSearch.chatKey.text = ""
contentComponent.contactListSearch.pubKey = ""
contentComponent.contactListSearch.pubKeys = []
contentComponent.contactListSearch.ensUsername = ""
contentComponent.contactListSearch.chatKey.forceActiveFocus(Qt.MouseFocusReason)
contentComponent.contactListSearch.existingContacts.visible = profileModel.contacts.list.hasAddedContacts()
contentComponent.contactListSearch.noContactsRect.visible = !contentComponent.contactListSearch.existingContacts.visible
2020-12-11 20:38:10 +00:00
}
2021-02-18 16:36:05 +00:00
//% "Invite friends"
header.title: qsTrId("invite-friends")
contentItem: CommunityProfilePopupInviteFriendsView {
id: contactFieldAndList
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
}
}
leftButtons: [
2020-12-11 20:38:10 +00:00
StatusRoundButton {
icon.name: "arrow-right"
icon.height: 16
icon.width: 20
2020-12-11 20:38:10 +00:00
rotation: 180
onClicked: {
popup.close()
2020-12-11 20:38:10 +00:00
}
}
]
2020-12-11 20:38:10 +00:00
rightButtons: [
2020-12-11 20:38:10 +00:00
StatusButton {
enabled: popup.contentComponent.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 : {
popup.contentComponent.sendInvites(popup.contentComponent.contactListSearch.pubKeys)
2020-12-11 20:38:10 +00:00
}
}
]
2020-12-11 20:38:10 +00:00
}