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