2022-09-16 00:17:51 +02:00
|
|
|
import QtQuick 2.14
|
2021-10-01 18:58:36 +03:00
|
|
|
|
2021-10-19 10:54:29 +02:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-09-16 00:17:51 +02:00
|
|
|
import StatusQ.Controls 0.1
|
2021-10-19 10:54:29 +02:00
|
|
|
|
2021-10-28 00:27:49 +03:00
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-12-11 15:29:46 -05:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
2022-09-16 00:17:51 +02:00
|
|
|
|
2021-10-21 03:41:54 +03:00
|
|
|
property var activeCommunity
|
2021-11-02 15:39:18 -04:00
|
|
|
property var store
|
2022-01-18 15:54:14 -05:00
|
|
|
property var communitySectionModule
|
2022-01-10 11:44:54 -05:00
|
|
|
property bool hasAddedContacts
|
2020-12-11 15:29:46 -05:00
|
|
|
|
2022-03-23 16:38:23 +01:00
|
|
|
signal manageCommunityClicked()
|
|
|
|
|
2022-09-16 00:17:51 +02:00
|
|
|
height: childrenRect.height + Style.current.padding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
border.color: Style.current.border
|
|
|
|
radius: 16
|
|
|
|
color: Style.current.transparent
|
2021-06-25 11:13:54 +02:00
|
|
|
|
2022-05-06 15:30:17 -04:00
|
|
|
Rectangle {
|
|
|
|
width: 70
|
|
|
|
height: 4
|
|
|
|
color: Style.current.secondaryMenuBackground
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: -2
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
}
|
|
|
|
|
2020-12-11 15:29:46 -05:00
|
|
|
SVGImage {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: -6
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2021-09-28 18:04:06 +03:00
|
|
|
source: Style.svg("chatEmptyHeader")
|
2020-12-11 15:29:46 -05:00
|
|
|
width: 66
|
|
|
|
height: 50
|
|
|
|
}
|
|
|
|
|
2022-09-16 00:17:51 +02:00
|
|
|
StatusFlatRoundButton {
|
2020-12-11 15:29:46 -05:00
|
|
|
id: closeImg
|
2021-10-18 12:34:16 +02:00
|
|
|
implicitWidth: 32
|
|
|
|
implicitHeight: 32
|
2020-12-11 15:29:46 -05:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 10
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 10
|
|
|
|
icon.height: 20
|
|
|
|
icon.width: 20
|
2021-10-18 12:34:16 +02:00
|
|
|
icon.name: "close-circle"
|
2022-09-16 00:17:51 +02:00
|
|
|
type: StatusFlatRoundButton.Type.Tertiary
|
2020-12-11 15:29:46 -05:00
|
|
|
onClicked: {
|
2021-11-02 15:39:18 -04:00
|
|
|
let hiddenBannerIds = localAccountSensitiveSettings.hiddenCommunityWelcomeBanners || []
|
|
|
|
if (hiddenBannerIds.includes(root.activeCommunity.id)) {
|
|
|
|
return
|
|
|
|
}
|
2021-10-21 03:41:54 +03:00
|
|
|
hiddenBannerIds.push(root.activeCommunity.id)
|
2021-10-20 11:50:50 +02:00
|
|
|
localAccountSensitiveSettings.hiddenCommunityWelcomeBanners = hiddenBannerIds
|
2020-12-11 15:29:46 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-19 10:54:29 +02:00
|
|
|
StatusBaseText {
|
2020-12-11 15:29:46 -05:00
|
|
|
id: welcomeText
|
2022-04-04 13:26:30 +02:00
|
|
|
text: qsTr("Welcome to your community!")
|
2020-12-11 15:29:46 -05:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 60
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.xlPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.xlPadding
|
|
|
|
}
|
|
|
|
|
2022-09-16 00:17:51 +02:00
|
|
|
StatusButton {
|
2020-12-11 15:29:46 -05:00
|
|
|
id: addMembersBtn
|
2022-10-25 14:39:21 -04:00
|
|
|
objectName:"CommunityWelcomeBannerPanel_AddMembersButton"
|
2022-04-04 13:26:30 +02:00
|
|
|
text: qsTr("Add members")
|
2020-12-11 15:29:46 -05:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-09-16 00:17:51 +02:00
|
|
|
anchors.top: welcomeText.bottom
|
|
|
|
anchors.topMargin: Style.current.padding
|
2022-09-29 00:07:18 +03:00
|
|
|
onClicked: {
|
|
|
|
Global.openInviteFriendsToCommunityPopup(root.activeCommunity,
|
2022-10-25 13:15:44 -04:00
|
|
|
root.communitySectionModule,
|
|
|
|
null)
|
2022-09-29 00:07:18 +03:00
|
|
|
}
|
2020-12-11 15:29:46 -05:00
|
|
|
}
|
|
|
|
|
2022-09-16 00:17:51 +02:00
|
|
|
StatusFlatButton {
|
2020-12-11 15:29:46 -05:00
|
|
|
id: manageBtn
|
2023-03-15 12:53:56 +00:00
|
|
|
objectName:"CommunityWelcomeBannerPanel_ManageCommunity"
|
2022-04-04 13:26:30 +02:00
|
|
|
text: qsTr("Manage community")
|
2020-12-11 15:29:46 -05:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-09-16 00:17:51 +02:00
|
|
|
anchors.top: addMembersBtn.bottom
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
2022-03-23 16:38:23 +01:00
|
|
|
|
|
|
|
onClicked: root.manageCommunityClicked()
|
2020-12-11 15:29:46 -05:00
|
|
|
}
|
|
|
|
}
|