status-desktop/ui/app/AppLayouts/Communities/panels/WelcomeBannerPanel.qml

111 lines
3.1 KiB
QML
Raw Normal View History

import QtQuick 2.15
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import AppLayouts.Chat.stores 1.0
import shared.panels 1.0
import shared.status 1.0
import utils 1.0
2020-12-11 20:29:46 +00:00
Rectangle {
id: root
property var activeCommunity
property RootStore store
property var communitySectionModule
property bool hasAddedContacts
2020-12-11 20:29:46 +00:00
signal manageCommunityClicked()
height: childrenRect.height + Theme.padding
anchors.left: parent.left
anchors.leftMargin: Theme.padding
anchors.right: parent.right
anchors.rightMargin: Theme.padding
border.color: Theme.palette.border
radius: 16
color: Theme.palette.transparent
Rectangle {
width: 70
height: 4
color: Theme.palette.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
source: Theme.svg("chatEmptyHeader")
2020-12-11 20:29:46 +00:00
width: 66
height: 50
}
StatusFlatRoundButton {
2020-12-11 20:29:46 +00:00
id: closeImg
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
icon.name: "close-circle"
type: StatusFlatRoundButton.Type.Tertiary
2020-12-11 20:29:46 +00:00
onClicked: {
let hiddenBannerIds = localAccountSensitiveSettings.hiddenCommunityWelcomeBanners || []
if (hiddenBannerIds.includes(root.activeCommunity.id)) {
return
}
hiddenBannerIds.push(root.activeCommunity.id)
localAccountSensitiveSettings.hiddenCommunityWelcomeBanners = hiddenBannerIds
2020-12-11 20:29:46 +00:00
}
}
StatusBaseText {
2020-12-11 20:29:46 +00:00
id: welcomeText
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: Theme.xlPadding
2020-12-11 20:29:46 +00:00
anchors.left: parent.left
anchors.leftMargin: Theme.xlPadding
2020-12-11 20:29:46 +00:00
}
StatusButton {
2020-12-11 20:29:46 +00:00
id: addMembersBtn
objectName:"CommunityWelcomeBannerPanel_AddMembersButton"
text: qsTr("Add members")
2020-12-11 20:29:46 +00:00
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: welcomeText.bottom
anchors.topMargin: Theme.padding
onClicked: {
Global.openInviteFriendsToCommunityPopup(root.activeCommunity,
root.communitySectionModule,
null)
}
2020-12-11 20:29:46 +00:00
}
StatusFlatButton {
2020-12-11 20:29:46 +00:00
id: manageBtn
objectName:"CommunityWelcomeBannerPanel_ManageCommunity"
text: qsTr("Manage community")
2020-12-11 20:29:46 +00:00
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: addMembersBtn.bottom
anchors.topMargin: Theme.halfPadding
onClicked: root.manageCommunityClicked()
2020-12-11 20:29:46 +00:00
}
}