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")
|
2021-07-16 12:36:27 +00:00
|
|
|
subTitle: `${Constants.communityLinkPrefix}${root.community.id.substring(0, 4)}...${root.community.id.substring(root.community.id.length -2)}`
|
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: {
|
2021-07-16 12:36:27 +00:00
|
|
|
let link = `${Constants.communityLinkPrefix}${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
|
2022-01-10 16:44:54 +00:00
|
|
|
visible: root.community.amISectionAdmin
|
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
|
2022-04-04 11:26:30 +00:00
|
|
|
title: qsTr("Leave community")
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.name: "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
|
|
|
}
|
2021-07-15 11:15:56 +00:00
|
|
|
|
|
|
|
/* // TODO add this back when roles exist */
|
|
|
|
/* // Loader { */
|
2021-07-16 12:36:27 +00:00
|
|
|
/* // active: root.community.isAdmin */
|
2021-07-15 11:15:56 +00:00
|
|
|
/* // width: parent.width */
|
|
|
|
/* // sourceComponent: CommunityPopupButton { */
|
2022-04-04 11:26:30 +00:00
|
|
|
/* // label: qsTr("Roles") */
|
2021-07-15 11:15:56 +00:00
|
|
|
/* // iconName: "roles" */
|
|
|
|
/* // width: parent.width */
|
|
|
|
/* // onClicked: console.log("TODO:") */
|
|
|
|
/* // txtColor: Style.current.textColor */
|
|
|
|
/* // SVGImage { */
|
|
|
|
/* // anchors.verticalCenter: parent.verticalCenter */
|
|
|
|
/* // anchors.right: parent.right */
|
|
|
|
/* // anchors.rightMargin: Style.current.padding */
|
2021-09-28 15:04:06 +00:00
|
|
|
/* // source: Style.svg("caret") */
|
2021-07-15 11:15:56 +00:00
|
|
|
/* // width: 13 */
|
|
|
|
/* // height: 7 */
|
|
|
|
/* // rotation: -90 */
|
|
|
|
/* // ColorOverlay { */
|
|
|
|
/* // anchors.fill: parent */
|
|
|
|
/* // source: parent */
|
|
|
|
/* // color: Style.current.secondaryText */
|
|
|
|
/* // } */
|
|
|
|
/* // } */
|
|
|
|
/* // } */
|
|
|
|
/* // } */
|
2021-03-16 13:07:09 +00:00
|
|
|
}
|