2021-03-16 14:07:09 +01:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-07-15 13:15:56 +02:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-03-16 14:07:09 +01:00
|
|
|
|
2021-07-15 13:15:56 +02:00
|
|
|
Column {
|
2021-03-16 14:07:09 +01:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property string headerTitle: ""
|
2021-07-15 13:15:56 +02:00
|
|
|
property string headerSubtitle: ""
|
2021-03-16 14:07:09 +01:00
|
|
|
property string headerImageSource: ""
|
2021-07-16 14:36:27 +02:00
|
|
|
property var community
|
2021-03-16 14:07:09 +01:00
|
|
|
|
2021-07-15 13:15:56 +02:00
|
|
|
signal leaveButtonClicked()
|
2021-10-21 03:41:54 +03:00
|
|
|
signal copyToClipboard(string link)
|
2021-07-15 13:15:56 +02:00
|
|
|
|
|
|
|
Item {
|
2021-07-16 09:53:41 +02:00
|
|
|
height: Math.max(46, communityDescription.height + 16)
|
2021-03-16 14:07:09 +01:00
|
|
|
width: parent.width
|
2021-07-15 13:15:56 +02:00
|
|
|
StatusBaseText {
|
|
|
|
id: communityDescription
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.leftMargin: 16
|
|
|
|
anchors.rightMargin: 16
|
2021-07-16 14:36:27 +02:00
|
|
|
text: root.community.description
|
2021-07-15 13:15:56 +02:00
|
|
|
font.pixelSize: 15
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
wrapMode: Text.Wrap
|
2022-03-28 15:53:50 +03:00
|
|
|
textFormat: Text.PlainText
|
2021-07-15 13:15:56 +02:00
|
|
|
}
|
2021-03-16 14:07:09 +01:00
|
|
|
}
|
|
|
|
|
2021-07-15 13:15:56 +02:00
|
|
|
StatusModalDivider {
|
|
|
|
bottomPadding: 8
|
2021-03-16 14:07:09 +01:00
|
|
|
}
|
|
|
|
|
2021-07-15 13:15:56 +02:00
|
|
|
StatusDescriptionListItem {
|
2022-04-04 13:26:30 +02:00
|
|
|
title: qsTr("Share community")
|
2023-03-14 20:20:25 +01:00
|
|
|
subTitle: Utils.getCommunityShareLink(root.community.id)
|
2022-03-07 12:35:30 +01:00
|
|
|
tooltip.text: qsTr("Copied!")
|
2022-08-11 14:55:08 +03:00
|
|
|
asset.name: "copy"
|
2021-07-15 13:15:56 +02:00
|
|
|
iconButton.onClicked: {
|
2022-10-26 16:08:59 +02:00
|
|
|
let link = Utils.getCommunityShareLink(root.community.id)
|
2021-10-21 03:41:54 +03:00
|
|
|
root.copyToClipboard(link);
|
2021-07-15 13:15:56 +02:00
|
|
|
tooltip.visible = !tooltip.visible
|
|
|
|
}
|
|
|
|
width: parent.width
|
2021-03-16 14:07:09 +01:00
|
|
|
}
|
|
|
|
|
2021-07-15 13:15:56 +02:00
|
|
|
StatusModalDivider {
|
|
|
|
topPadding: 8
|
|
|
|
bottomPadding: 8
|
2021-03-16 14:07:09 +01:00
|
|
|
}
|
|
|
|
|
2021-07-15 13:15:56 +02:00
|
|
|
StatusListItem {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2023-06-19 16:16:35 +02:00
|
|
|
visible: root.community.memberRole !== Constants.memberRole.owner
|
2023-06-14 10:42:52 +02:00
|
|
|
title: root.community.spectated ? qsTr("Close Community") : qsTr("Leave Community")
|
|
|
|
asset.name: root.community.spectated ? "close-circle" : "arrow-left"
|
2021-07-21 11:52:10 +02:00
|
|
|
type: StatusListItem.Type.Danger
|
2022-08-24 17:37:05 +03:00
|
|
|
onClicked: root.leaveButtonClicked()
|
2021-03-16 14:07:09 +01:00
|
|
|
}
|
|
|
|
}
|