diff --git a/storybook/pages/AirdropsSettingsPanelPage.qml b/storybook/pages/AirdropsSettingsPanelPage.qml index 66773d9f33..4c878d3f55 100644 --- a/storybook/pages/AirdropsSettingsPanelPage.qml +++ b/storybook/pages/AirdropsSettingsPanelPage.qml @@ -91,6 +91,8 @@ SplitView { anchors.fill: parent anchors.topMargin: 50 isOwner: ownerChecked.checked + isTokenMasterOwner: masterTokenOwnerChecked.checked + isAdmin: adminChecked.checked tokensModel: editorModelChecked.checked ? emptyModel : mintedTokensModel assetsModel: AssetsModel {} collectiblesModel: ListModel {} @@ -199,7 +201,7 @@ SplitView { id: logsAndControlsPanel SplitView.minimumHeight: 100 - SplitView.preferredHeight: 150 + SplitView.preferredHeight: 250 logsView.logText: logs.logText @@ -208,14 +210,28 @@ SplitView { id: ownerChecked checked: true - text: "Is owner?" + text: "Is Owner? [Owner will be able to create an OWNER and TOKEN MASTER token]" + } + + CheckBox { + id: masterTokenOwnerChecked + checked: true + + text: "Is TMaster token owner? [TMaster token owner will be able to mint / airdrop tokens once the TMaster is already created]" + } + + CheckBox { + id: adminChecked + checked: true + + text: "Is admin? [Admis will be able to see token views, but NOT manage them, like creating new artwork or asset]" } CheckBox { id: editorModelChecked checked: true - text: "Empty model" + text: "No tokens minted yet" } } } diff --git a/ui/app/AppLayouts/Communities/panels/AirdropsSettingsPanel.qml b/ui/app/AppLayouts/Communities/panels/AirdropsSettingsPanel.qml index e34c837e48..e93c1241c3 100644 --- a/ui/app/AppLayouts/Communities/panels/AirdropsSettingsPanel.qml +++ b/ui/app/AppLayouts/Communities/panels/AirdropsSettingsPanel.qml @@ -14,6 +14,8 @@ StackView { // id, name, image, color, owner properties expected required property var communityDetails required property bool isOwner + required property bool isTokenMasterOwner + required property bool isAdmin // Token models: required property var assetsModel @@ -53,6 +55,8 @@ StackView { QtObject { id: d + readonly property bool isAdminOnly: root.isAdmin && !root.isOwner && !root.isTokenMasterOwner + signal selectToken(string key, int amount, int type) signal addAddresses(var addresses) } @@ -62,10 +66,11 @@ StackView { title: qsTr("Airdrops") buttons: StatusButton { + objectName: "addNewItemButton" text: qsTr("New Airdrop") - enabled: root.tokensModel.count > 0 // TODO: Replace to checker to ensure owner token is deployed + enabled: !d.isAdminOnly && root.tokensModel.count > 0 // TODO: Replace to checker to ensure owner token is deployed onClicked: root.push(newAirdropView, StackView.Immediate) } @@ -80,11 +85,13 @@ StackView { qsTr("Incentivise joining, retention, moderation and desired behaviour"), qsTr("Require holding a token or NFT to obtain exclusive membership rights") ] - infoBoxVisible: root.isOwner && root.tokensModel.count === 0 // TODO: Replace to checker to ensure owner token is NOT deployed yet + infoBoxVisible: d.isAdminOnly || ((root.isOwner || root.isTokenMasterOwner) && root.tokensModel.count === 0) // TODO: Replace to checker to ensure owner token is NOT deployed yet infoBoxTitle: qsTr("Get started") - infoBoxText: qsTr("In order to Mint, Import and Airdrop community tokens, you first need to mint your Owner token which will give you permissions to access the token management features for your community.") + infoBoxText: d.isAdminOnly ? qsTr("Token airdropping can only be performed by admins that hodl the Community’s TokenMaster token. If you would like this permission, contact the Community founder (they will need to mint the Community Owner token before they can airdrop this to you)."): + qsTr("In order to Mint, Import and Airdrop community tokens, you first need to mint your Owner token which will give you permissions to access the token management features for your community.") buttonText: qsTr("Mint Owner token") - onClicked: root.navigateToMintTokenSettings(false) // TEMP: Replace to mint owner token page + buttonVisible: root.isOwner + onClicked: root.navigateToMintTokenSettings(false) } } diff --git a/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml b/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml index 6879898b92..8f724cb483 100644 --- a/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml +++ b/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml @@ -364,6 +364,8 @@ StatusSectionLayout { communityDetails: d.communityDetails isOwner: root.isOwner + isTokenMasterOwner: false // TODO: Backend + isAdmin: root.isAdmin tokensModel: root.community.communityTokens readonly property CommunityTokensStore communityTokensStore: diff --git a/ui/app/AppLayouts/Communities/views/WelcomeSettingsView.qml b/ui/app/AppLayouts/Communities/views/WelcomeSettingsView.qml index ad8a5e0dd4..8a50e9b3eb 100644 --- a/ui/app/AppLayouts/Communities/views/WelcomeSettingsView.qml +++ b/ui/app/AppLayouts/Communities/views/WelcomeSettingsView.qml @@ -20,6 +20,7 @@ StatusScrollView { property alias infoBoxTitle: infoBox.title property alias infoBoxText: infoBox.text property alias buttonText: infoBox.buttonText + property alias buttonVisible: infoBox.buttonVisible signal clicked