2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
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()
|
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
height: childrenRect.height + Theme.padding
|
2022-09-15 22:17:51 +00:00
|
|
|
anchors.left: parent.left
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.leftMargin: Theme.padding
|
2022-09-15 22:17:51 +00:00
|
|
|
anchors.right: parent.right
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.rightMargin: Theme.padding
|
|
|
|
border.color: Theme.palette.border
|
2022-09-15 22:17:51 +00:00
|
|
|
radius: 16
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.transparent
|
2021-06-25 09:13:54 +00:00
|
|
|
|
2022-05-06 19:30:17 +00:00
|
|
|
Rectangle {
|
|
|
|
width: 70
|
|
|
|
height: 4
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.secondaryMenuBackground
|
2022-05-06 19:30:17 +00:00
|
|
|
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
|
2024-10-15 19:26:12 +00:00
|
|
|
source: Theme.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
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.rightMargin: Theme.xlPadding
|
2020-12-11 20:29:46 +00:00
|
|
|
anchors.left: parent.left
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.leftMargin: Theme.xlPadding
|
2020-12-11 20:29:46 +00:00
|
|
|
}
|
|
|
|
|
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
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.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
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.halfPadding
|
2022-03-23 15:38:23 +00:00
|
|
|
|
|
|
|
onClicked: root.manageCommunityClicked()
|
2020-12-11 20:29:46 +00:00
|
|
|
}
|
|
|
|
}
|