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