status-desktop/ui/app/AppLayouts/Communities/views/OwnerTokenWelcomeView.qml

188 lines
6.6 KiB
QML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import QtQuick 2.15
import QtQuick.Layouts 1.15
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1
import AppLayouts.Communities.panels 1.0
import AppLayouts.Communities.helpers 1.0
import utils 1.0
StatusScrollView {
id: root
property int viewWidth: 560 // by design
required property string communityLogo
required property color communityColor
required property string communityName
signal nextClicked
padding: 0
contentWidth: mainLayout.width
contentHeight: mainLayout.height
ColumnLayout {
id: mainLayout
width: root.viewWidth
spacing: 20
StatusBaseText {
id: introPanel
Layout.fillWidth: true
wrapMode: Text.WordWrap
lineHeight: 1.2
font.pixelSize: Theme.primaryTextFontSize
text: qsTr("Your <b>Owner token</b> will give you permissions to access the token management features for your community. This token is very important - only one will ever exist, and if this token gets lost then access to the permissions it enables for your community will be lost forever as well.<br><br>
Minting your Owner token also automatically mints your communitys <b>TokenMaster token</b>. You can airdrop your communitys TokenMaster token to anybody you wish to grant both Admin permissions and permission to access your communitys token management functions to.<br><br>
Only the hodler of the Owner token can airdrop TokenMaster tokens. TokenMaster tokens are soulbound (meaning they cant be transferred), and you (the hodler of the Owner token) can remotely destruct a TokenMaster token at any time, to revoke TokenMaster permissions from any individual.")
}
InfoPanel {
isOwner: true
checkersModel: [
qsTr("Only 1 will ever exist"),
qsTr("Hodler is the owner of the Community"),
qsTr("Ability to airdrop / destroy TokenMaster token"),
qsTr("Ability to mint and airdrop Community tokens")
]
}
InfoPanel {
isOwner: false
showTag: true
checkersModel: [
qsTr("Unlimited supply"),
qsTr("Grants full Community admin rights"),
qsTr("Ability to mint and airdrop Community tokens"),
qsTr("Non-transferrable"),
qsTr("Remotely destructible by the Owner token hodler")
]
}
component InfoPanel : Rectangle {
id: panel
property bool isOwner
property bool showTag
property alias checkersModel: checkersItems.model
readonly property int margins: Theme.bigPadding
Layout.fillWidth: true
Layout.preferredHeight: panelRow.implicitHeight
color: "transparent"
radius: 8
border.color: Theme.palette.baseColor2
RowLayout {
id: panelRow
width: parent.width
spacing: panel.margins
PrivilegedTokenArtworkPanel {
Layout.alignment: Qt.AlignTop
Layout.topMargin: panel.margins
Layout.leftMargin: Layout.topMargin
isOwner: panel.isOwner
artwork: root.communityLogo
color: root.communityColor
showTag: panel.showTag
}
ColumnLayout {
id: col
Layout.alignment: Qt.AlignTop
Layout.topMargin: panel.margins
Layout.bottomMargin: panel.margins
Layout.fillWidth: true
Item {
id: panelTextHeader
Layout.fillWidth: true
Layout.preferredHeight: headerRow.implicitHeight
Layout.rightMargin: panel.margins
RowLayout {
id: headerRow
spacing: Theme.halfPadding
StatusBaseText {
Layout.alignment: Qt.AlignBottom
Layout.maximumWidth: panelTextHeader.width - symbol.width
text: panel.isOwner ? qsTr("%1 Owner token").arg(root.communityName) :
qsTr("%1 TokenMaster token").arg(root.communityName)
font.bold: true
font.pixelSize: 17
elide: Text.ElideMiddle
}
StatusBaseText {
id: symbol
Layout.alignment: Qt.AlignBottom
text: PermissionsHelpers.communityNameToSymbol(panel.isOwner, root.communityName)
font.pixelSize: Theme.primaryTextFontSize
color: Theme.palette.baseColor1
}
}
}
ColumnLayout {
id: checkersColumn
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
Layout.topMargin: 6
Repeater {
id: checkersItems
RowLayout {
StatusIcon {
icon: "tiny/checkmark"
color: Theme.palette.successColor1
width: 20
height: width
}
StatusBaseText {
Layout.fillWidth: true
Layout.rightMargin: panel.margins
text: modelData
lineHeight: 1.2
font.pixelSize: Theme.additionalTextSize
wrapMode: Text.WordWrap
}
}
}
}
}
}
}
StatusButton {
Layout.alignment: Qt.AlignHCenter
Layout.bottomMargin: Theme.bigPadding
text: qsTr("Next")
onClicked: root.nextClicked()
}
}
}