2023-07-04 15:11:41 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2022-05-26 15:46:02 +00:00
|
|
|
|
2022-10-21 11:27:08 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2024-03-27 12:48:17 +00:00
|
|
|
import StatusQ 0.1
|
2022-05-26 15:46:02 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Components 0.1
|
2023-07-04 15:11:41 +00:00
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
import StatusQ.Core.Utils 0.1
|
2022-05-26 15:46:02 +00:00
|
|
|
|
2023-07-04 15:11:41 +00:00
|
|
|
import AppLayouts.Communities.panels 1.0
|
2024-03-27 12:48:17 +00:00
|
|
|
import AppLayouts.Communities.controls 1.0
|
|
|
|
import AppLayouts.Communities.helpers 1.0
|
2023-07-04 15:11:41 +00:00
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
|
|
StatusStackModal {
|
2022-05-26 15:46:02 +00:00
|
|
|
id: root
|
|
|
|
|
2024-03-27 09:06:14 +00:00
|
|
|
destroyOnClose: true
|
2024-03-19 08:41:41 +00:00
|
|
|
property bool isEditMode: false
|
|
|
|
|
2024-03-28 23:05:59 +00:00
|
|
|
required property string communityId
|
2024-03-19 08:41:41 +00:00
|
|
|
required property string communityName
|
|
|
|
required property string communityIcon
|
|
|
|
required property bool requirementsCheckPending
|
|
|
|
|
2024-05-16 09:28:06 +00:00
|
|
|
property bool checkingPermissionToJoinInProgress
|
|
|
|
property bool joinPermissionsCheckCompletedWithoutErrors
|
2024-04-25 09:47:40 +00:00
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
property string introMessage
|
2024-03-19 08:41:41 +00:00
|
|
|
|
2022-10-21 10:09:17 +00:00
|
|
|
property bool isInvitationPending: false
|
2022-05-26 15:46:02 +00:00
|
|
|
|
2023-07-04 15:11:41 +00:00
|
|
|
required property var walletAccountsModel // name, address, emoji, colorId
|
2024-03-28 23:05:59 +00:00
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
required property var walletAssetsModel
|
2024-03-28 23:05:59 +00:00
|
|
|
required property var walletCollectiblesModel
|
|
|
|
|
2023-07-04 15:11:41 +00:00
|
|
|
required property var permissionsModel // id, key, permissionType, holdingsListModel, channelsListModel, isPrivate, tokenCriteriaMet
|
|
|
|
required property var assetsModel
|
|
|
|
required property var collectiblesModel
|
2022-05-26 15:46:02 +00:00
|
|
|
|
2023-10-27 17:14:39 +00:00
|
|
|
property var keypairSigningModel
|
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
property var currentSharedAddresses: []
|
|
|
|
onCurrentSharedAddressesChanged: d.reEvaluateModels()
|
|
|
|
property string currentAirdropAddress: ""
|
|
|
|
onCurrentAirdropAddressChanged: d.reEvaluateModels()
|
|
|
|
|
2024-01-24 16:35:53 +00:00
|
|
|
property var getCurrencyAmount: function (balance, symbol){}
|
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
property var canProfileProveOwnershipOfProvidedAddressesFn: function(addresses) { return false }
|
|
|
|
|
|
|
|
readonly property bool profileProvesOwnershipOfSelectedAddresses: {
|
|
|
|
d.selectedSharedAddressesMap // needed for binding
|
|
|
|
const obj = d.getSelectedAddresses()
|
|
|
|
return root.canProfileProveOwnershipOfProvidedAddressesFn(obj.addresses)
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property bool allAddressesToRevealBelongToSingleNonProfileKeypair: {
|
|
|
|
const keyUids = new Set()
|
|
|
|
for (const [key, value] of d.selectedSharedAddressesMap) {
|
|
|
|
keyUids.add(value.keyUid)
|
|
|
|
}
|
|
|
|
return keyUids.size === 1 && !keyUids.has(userProfile.keyUid)
|
|
|
|
}
|
|
|
|
|
2023-10-27 17:14:39 +00:00
|
|
|
signal prepareForSigning(string airdropAddress, var sharedAddresses)
|
|
|
|
signal joinCommunity()
|
2024-03-19 08:41:41 +00:00
|
|
|
signal editRevealedAddresses()
|
|
|
|
signal signProfileKeypairAndAllNonKeycardKeypairs()
|
2023-10-27 17:14:39 +00:00
|
|
|
signal signSharedAddressesForKeypair(string keyUid)
|
2023-07-04 15:11:41 +00:00
|
|
|
signal cancelMembershipRequest()
|
2023-08-21 18:54:57 +00:00
|
|
|
signal sharedAddressesUpdated(var sharedAddresses)
|
2022-10-21 10:09:17 +00:00
|
|
|
|
2023-07-04 15:11:41 +00:00
|
|
|
width: 640 // by design
|
|
|
|
padding: 0
|
2024-03-27 12:48:17 +00:00
|
|
|
stackTitle: d.accessType === Constants.communityChatOnRequestAccess ?
|
2024-03-19 08:41:41 +00:00
|
|
|
qsTr("Request to join %1").arg(root.communityName)
|
|
|
|
: qsTr("Welcome to %1").arg(root.communityName)
|
2023-07-04 15:11:41 +00:00
|
|
|
|
|
|
|
rightButtons: [d.shareButton, finishButton]
|
|
|
|
|
2024-03-27 12:48:17 +00:00
|
|
|
finishButton: StatusButton {
|
2024-04-25 09:47:40 +00:00
|
|
|
interactive: {
|
2024-05-16 09:28:06 +00:00
|
|
|
if (root.isInvitationPending || d.accessType !== Constants.communityChatOnRequestAccess)
|
2024-04-25 09:47:40 +00:00
|
|
|
return true
|
|
|
|
|
2024-05-16 09:28:06 +00:00
|
|
|
if (root.checkingPermissionToJoinInProgress || !root.joinPermissionsCheckCompletedWithoutErrors)
|
2024-04-25 09:47:40 +00:00
|
|
|
return false
|
|
|
|
|
2024-03-27 12:48:17 +00:00
|
|
|
return d.eligibleToJoinAs !== PermissionTypes.Type.None
|
|
|
|
}
|
2024-05-16 09:28:06 +00:00
|
|
|
loading: root.checkingPermissionToJoinInProgress && !root.isInvitationPending
|
2024-04-25 09:47:40 +00:00
|
|
|
tooltip.text: {
|
|
|
|
if (interactive)
|
|
|
|
return ""
|
|
|
|
|
2024-05-16 09:28:06 +00:00
|
|
|
if (root.checkingPermissionToJoinInProgress)
|
2024-04-25 09:47:40 +00:00
|
|
|
return qsTr("Requirements check pending")
|
|
|
|
|
2024-05-16 09:28:06 +00:00
|
|
|
if (!root.joinPermissionsCheckCompletedWithoutErrors)
|
2024-04-25 09:47:40 +00:00
|
|
|
return qsTr("Checking permissions to join failed")
|
|
|
|
|
|
|
|
return ""
|
|
|
|
}
|
2024-03-27 12:48:17 +00:00
|
|
|
text: {
|
|
|
|
if (root.isInvitationPending) {
|
|
|
|
return qsTr("Cancel Membership Request")
|
|
|
|
}
|
|
|
|
if (d.selectedSharedAddressesCount === d.totalNumOfAddressesForSharing) {
|
|
|
|
return qsTr("Share all addresses to join")
|
|
|
|
}
|
|
|
|
return qsTr("Share %n address(s) to join", "", d.selectedSharedAddressesCount)
|
|
|
|
}
|
|
|
|
type: root.isInvitationPending ? StatusBaseButton.Type.Danger
|
|
|
|
: StatusBaseButton.Type.Normal
|
|
|
|
|
|
|
|
icon.name: {
|
|
|
|
if (root.isInvitationPending)
|
|
|
|
return ""
|
|
|
|
|
|
|
|
if (root.profileProvesOwnershipOfSelectedAddresses) {
|
|
|
|
if (userProfile.usingBiometricLogin) {
|
|
|
|
return "touch-id"
|
|
|
|
}
|
|
|
|
|
|
|
|
if (userProfile.isKeycardUser) {
|
|
|
|
return "keycard"
|
|
|
|
}
|
|
|
|
|
|
|
|
return "password"
|
|
|
|
}
|
|
|
|
if (root.allAddressesToRevealBelongToSingleNonProfileKeypair) {
|
|
|
|
return "keycard"
|
|
|
|
}
|
|
|
|
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
if (root.isInvitationPending) {
|
|
|
|
root.cancelMembershipRequest()
|
|
|
|
root.close()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
d.proceedToSigningOrSubmitRequest(d.communityIntroUid)
|
|
|
|
}
|
|
|
|
}
|
2022-05-26 15:46:02 +00:00
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
backButton: StatusBackButton {
|
|
|
|
visible: !!root.replaceLoader.item
|
|
|
|
&& !(root.replaceLoader.item.componentUid === d.shareAddressesUid && root.isEditMode)
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
if (d.backActionGoesTo === d.communityIntroUid) {
|
|
|
|
if (root.replaceItem) {
|
|
|
|
root.replaceItem = undefined
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if (d.backActionGoesTo === d.shareAddressesUid) {
|
|
|
|
d.backActionGoesTo = d.communityIntroUid
|
|
|
|
root.replace(sharedAddressesPanelComponent)
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Layout.minimumWidth: implicitWidth
|
|
|
|
}
|
|
|
|
|
2023-07-04 15:11:41 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
2022-05-26 15:46:02 +00:00
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
readonly property string communityIntroUid: "community-intro"
|
|
|
|
readonly property string shareAddressesUid: "shared-addresses"
|
|
|
|
readonly property string signingPanelUid: "signing-panel"
|
|
|
|
property string backActionGoesTo: d.communityIntroUid
|
|
|
|
|
|
|
|
readonly property int totalNumOfAddressesForSharing: root.walletAccountsModel.count
|
|
|
|
|
|
|
|
property var currentSharedAddressesMap: new Map() // Map[address, [keyUid, selected, isAirdrop]] - used in edit mode only
|
|
|
|
property var selectedSharedAddressesMap: new Map() // Map[address, [keyUid, selected, isAirdrop]]
|
2024-03-25 17:19:17 +00:00
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
readonly property int selectedSharedAddressesCount: d.selectedSharedAddressesMap.size
|
|
|
|
|
2024-04-12 09:52:53 +00:00
|
|
|
readonly property int accessType: d.eligibleToJoinAs !== -1 ? Constants.communityChatOnRequestAccess
|
|
|
|
: Constants.communityChatPublicAccess
|
2024-03-27 12:48:17 +00:00
|
|
|
property int eligibleToJoinAs: PermissionsHelpers.isEligibleToJoinAs(root.permissionsModel)
|
|
|
|
readonly property var _con: Connections {
|
|
|
|
target: root.permissionsModel
|
2024-05-16 09:28:06 +00:00
|
|
|
ignoreUnknownSignals: true
|
2024-03-27 12:48:17 +00:00
|
|
|
function onTokenCriteriaUpdated() {
|
|
|
|
d.eligibleToJoinAs = PermissionsHelpers.isEligibleToJoinAs(root.permissionsModel)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-01 14:24:18 +00:00
|
|
|
readonly property var initialAddressesModel: SortFilterProxyModel {
|
2023-07-04 15:11:41 +00:00
|
|
|
sourceModel: root.walletAccountsModel
|
|
|
|
}
|
2022-05-26 15:46:02 +00:00
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
function proceedToSigningOrSubmitRequest(uidOfComponentThisFunctionIsCalledFrom) {
|
|
|
|
const selected = d.getSelectedAddresses()
|
|
|
|
root.prepareForSigning(selected.airdropAddress, selected.addresses)
|
|
|
|
if (root.profileProvesOwnershipOfSelectedAddresses) {
|
|
|
|
root.signProfileKeypairAndAllNonKeycardKeypairs()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if (root.allAddressesToRevealBelongToSingleNonProfileKeypair) {
|
|
|
|
if (d.selectedSharedAddressesMap.size === 0) {
|
|
|
|
console.error("selected shared addresses must not be empty")
|
|
|
|
return
|
|
|
|
}
|
2024-03-27 09:25:07 +00:00
|
|
|
const keyUid = d.selectedSharedAddressesMap.values().next().value.keyUid
|
2024-03-19 08:41:41 +00:00
|
|
|
root.signSharedAddressesForKeypair(keyUid)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
d.backActionGoesTo = uidOfComponentThisFunctionIsCalledFrom
|
|
|
|
root.replace(sharedAddressesSigningPanelComponent)
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function deletes/adds it the address from/to the map.
|
|
|
|
function toggleAddressSelection(keyUid, address) {
|
|
|
|
const tmpMap = d.selectedSharedAddressesMap
|
|
|
|
|
|
|
|
const lAddress = address.toLowerCase()
|
|
|
|
const obj = tmpMap.get(lAddress)
|
|
|
|
if (!!obj) {
|
|
|
|
if (tmpMap.size === 1) {
|
|
|
|
console.error("cannot remove the last selected address")
|
|
|
|
}
|
|
|
|
tmpMap.delete(lAddress)
|
|
|
|
if (obj.isAirdrop) {
|
|
|
|
d.selectAirdropAddressForTheFirstSelectedAddress()
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
tmpMap.set(lAddress, {keyUid: keyUid, selected: true, isAirdrop: false})
|
|
|
|
}
|
|
|
|
|
|
|
|
d.selectedSharedAddressesMap = tmpMap
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function selects new airdrop address, invalidating old airdrop address selection.
|
|
|
|
function selectAirdropAddressForTheFirstSelectedAddress() {
|
|
|
|
const tmpMap = d.selectedSharedAddressesMap
|
|
|
|
|
|
|
|
// clear previous airdrop address
|
|
|
|
for (const [key, value] of tmpMap) {
|
|
|
|
if (!value.isAirdrop) {
|
|
|
|
d.selectedSharedAddressesMap.set(key, {keyUid: value.keyUid, selected: value.selected, isAirdrop: true})
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
d.selectedSharedAddressesMap = tmpMap
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function selects new airdrop address, invalidating old airdrop address selection.
|
|
|
|
function selectAirdropAddress(address) {
|
|
|
|
const tmpMap = d.selectedSharedAddressesMap
|
|
|
|
|
|
|
|
// clear previous airdrop address
|
|
|
|
for (const [key, value] of tmpMap) {
|
|
|
|
if (value.isAirdrop) {
|
|
|
|
tmpMap.set(key, {keyUid: value.keyUid, selected: value.selected, isAirdrop: false})
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// set new airdrop address
|
|
|
|
const lAddress = address.toLowerCase()
|
|
|
|
const obj = tmpMap.get(lAddress)
|
|
|
|
if (!obj) {
|
|
|
|
console.error("cannot set airdrop address for unselected address")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
obj.isAirdrop = true
|
|
|
|
tmpMap.set(lAddress, obj)
|
|
|
|
|
|
|
|
d.selectedSharedAddressesMap = tmpMap
|
|
|
|
}
|
|
|
|
|
2024-04-25 09:47:40 +00:00
|
|
|
// Returns an object containing all selected addresses and selected airdrop address
|
2024-03-19 08:41:41 +00:00
|
|
|
function getSelectedAddresses() {
|
|
|
|
const result = {addresses: [], airdropAddress: ""}
|
|
|
|
for (const [key, value] of d.selectedSharedAddressesMap) {
|
|
|
|
if (value.selected) {
|
|
|
|
result.addresses.push(key)
|
|
|
|
}
|
|
|
|
if (value.isAirdrop) {
|
|
|
|
result.airdropAddress = key
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
function reEvaluateModels() {
|
|
|
|
const tmpSharedAddressesMap = new Map()
|
|
|
|
const tmpCurrentSharedAddressesMap = new Map()
|
|
|
|
for (let i=0; i < d.initialAddressesModel.count; ++i){
|
|
|
|
const obj = d.initialAddressesModel.get(i)
|
2024-03-25 17:19:17 +00:00
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
if (!!obj) {
|
2024-03-25 17:19:17 +00:00
|
|
|
const lAddress = obj.address.toLowerCase()
|
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
let isAirdrop = i === 0
|
|
|
|
if (root.isEditMode) {
|
|
|
|
if (root.currentSharedAddresses.indexOf(obj.address) === -1) {
|
|
|
|
continue
|
|
|
|
}
|
2024-03-25 17:19:17 +00:00
|
|
|
isAirdrop = lAddress === root.currentAirdropAddress.toLowerCase()
|
2024-03-19 08:41:41 +00:00
|
|
|
}
|
2024-03-25 17:19:17 +00:00
|
|
|
tmpSharedAddressesMap.set(lAddress, {keyUid: obj.keyUid, selected: true, isAirdrop: isAirdrop})
|
|
|
|
tmpCurrentSharedAddressesMap.set(lAddress, {keyUid: obj.keyUid, selected: true, isAirdrop: isAirdrop})
|
2024-03-19 08:41:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
d.selectedSharedAddressesMap = tmpSharedAddressesMap
|
|
|
|
if (root.isEditMode) {
|
|
|
|
d.currentSharedAddressesMap = new Map(tmpCurrentSharedAddressesMap)
|
|
|
|
}
|
|
|
|
}
|
2022-05-26 15:46:02 +00:00
|
|
|
|
2023-07-04 15:11:41 +00:00
|
|
|
readonly property var shareButton: StatusFlatButton {
|
|
|
|
height: finishButton.height
|
|
|
|
visible: !root.isInvitationPending && !root.replaceItem
|
2024-03-19 08:41:41 +00:00
|
|
|
borderColor: "transparent"
|
2023-07-04 15:11:41 +00:00
|
|
|
text: qsTr("Select addresses to share")
|
2024-03-19 08:41:41 +00:00
|
|
|
onClicked: {
|
|
|
|
d.backActionGoesTo = d.communityIntroUid
|
|
|
|
root.replace(sharedAddressesPanelComponent)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
d.reEvaluateModels()
|
|
|
|
|
|
|
|
if (root.isEditMode) {
|
|
|
|
d.backActionGoesTo = d.shareAddressesUid
|
|
|
|
root.replace(sharedAddressesPanelComponent)
|
2023-07-04 15:11:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: sharedAddressesPanelComponent
|
|
|
|
SharedAddressesPanel {
|
2024-03-19 08:41:41 +00:00
|
|
|
componentUid: d.shareAddressesUid
|
|
|
|
isEditMode: root.isEditMode
|
2024-03-28 23:05:59 +00:00
|
|
|
|
|
|
|
communityId: root.communityId
|
2024-03-19 08:41:41 +00:00
|
|
|
communityName: root.communityName
|
|
|
|
communityIcon: root.communityIcon
|
2023-08-22 18:04:58 +00:00
|
|
|
requirementsCheckPending: root.requirementsCheckPending
|
2024-05-16 09:28:06 +00:00
|
|
|
checkingPermissionToJoinInProgress: root.checkingPermissionToJoinInProgress
|
|
|
|
joinPermissionsCheckCompletedWithoutErrors: root.joinPermissionsCheckCompletedWithoutErrors
|
2023-08-09 12:31:58 +00:00
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
walletAccountsModel: d.initialAddressesModel
|
2024-03-28 23:05:59 +00:00
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
selectedSharedAddressesMap: d.selectedSharedAddressesMap
|
|
|
|
currentSharedAddressesMap: d.currentSharedAddressesMap
|
|
|
|
|
|
|
|
totalNumOfAddressesForSharing: d.totalNumOfAddressesForSharing
|
2024-03-27 12:48:17 +00:00
|
|
|
eligibleToJoinAs: d.eligibleToJoinAs
|
2024-03-25 17:19:17 +00:00
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
profileProvesOwnershipOfSelectedAddresses: root.profileProvesOwnershipOfSelectedAddresses
|
|
|
|
allAddressesToRevealBelongToSingleNonProfileKeypair: root.allAddressesToRevealBelongToSingleNonProfileKeypair
|
|
|
|
|
2024-01-24 16:35:53 +00:00
|
|
|
walletAssetsModel: root.walletAssetsModel
|
2024-03-28 23:05:59 +00:00
|
|
|
walletCollectiblesModel: root.walletCollectiblesModel
|
|
|
|
|
2023-07-04 15:11:41 +00:00
|
|
|
permissionsModel: root.permissionsModel
|
|
|
|
assetsModel: root.assetsModel
|
|
|
|
collectiblesModel: root.collectiblesModel
|
2024-03-19 08:41:41 +00:00
|
|
|
|
|
|
|
onClose: {
|
|
|
|
root.close()
|
|
|
|
}
|
|
|
|
|
|
|
|
onToggleAddressSelection: {
|
|
|
|
d.toggleAddressSelection(keyUid, address)
|
|
|
|
|
|
|
|
const obj = d.getSelectedAddresses()
|
|
|
|
root.sharedAddressesUpdated(obj.addresses)
|
2023-08-21 18:54:57 +00:00
|
|
|
}
|
2024-03-19 08:41:41 +00:00
|
|
|
|
|
|
|
onAirdropAddressSelected: {
|
|
|
|
d.selectAirdropAddress(address)
|
|
|
|
}
|
|
|
|
|
|
|
|
onShareSelectedAddressesClicked: {
|
|
|
|
d.proceedToSigningOrSubmitRequest(d.shareAddressesUid)
|
2023-10-27 17:14:39 +00:00
|
|
|
}
|
2024-03-19 08:41:41 +00:00
|
|
|
|
2024-01-24 16:35:53 +00:00
|
|
|
getCurrencyAmount: function (balance, symbol){
|
|
|
|
return root.getCurrencyAmount(balance, symbol)
|
|
|
|
}
|
2023-10-27 17:14:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: sharedAddressesSigningPanelComponent
|
|
|
|
SharedAddressesSigningPanel {
|
2024-03-19 08:41:41 +00:00
|
|
|
componentUid: d.signingPanelUid
|
|
|
|
isEditMode: root.isEditMode
|
|
|
|
totalNumOfAddressesForSharing: d.totalNumOfAddressesForSharing
|
|
|
|
selectedSharedAddressesMap: d.selectedSharedAddressesMap
|
|
|
|
|
|
|
|
communityName: root.communityName
|
2023-10-27 17:14:39 +00:00
|
|
|
keypairSigningModel: root.keypairSigningModel
|
|
|
|
|
2024-03-19 08:41:41 +00:00
|
|
|
onSignProfileKeypairAndAllNonKeycardKeypairs: {
|
|
|
|
root.signProfileKeypairAndAllNonKeycardKeypairs()
|
2023-10-27 17:14:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
onSignSharedAddressesForKeypair: {
|
|
|
|
root.signSharedAddressesForKeypair(keyUid)
|
|
|
|
}
|
|
|
|
|
|
|
|
onJoinCommunity: {
|
2024-03-19 08:41:41 +00:00
|
|
|
if (root.isEditMode) {
|
|
|
|
root.editRevealedAddresses()
|
|
|
|
} else {
|
|
|
|
root.joinCommunity()
|
|
|
|
}
|
2023-10-27 17:14:39 +00:00
|
|
|
root.close()
|
2023-02-03 12:27:42 +00:00
|
|
|
}
|
2023-07-04 15:11:41 +00:00
|
|
|
}
|
|
|
|
}
|
2022-05-26 15:46:02 +00:00
|
|
|
|
2023-07-04 15:11:41 +00:00
|
|
|
stackItems: [
|
2024-04-25 09:47:40 +00:00
|
|
|
Item {
|
|
|
|
implicitHeight: scrollView.contentHeight + scrollView.bottomPadding + eligibilityTag.anchors.bottomMargin
|
|
|
|
|
|
|
|
StatusScrollView {
|
|
|
|
id: scrollView
|
|
|
|
anchors.fill: parent
|
|
|
|
contentWidth: availableWidth
|
|
|
|
bottomPadding: 80
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
spacing: Style.current.bigPadding
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
StatusRoundedImage {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredWidth: 64
|
2024-05-16 09:28:06 +00:00
|
|
|
Layout.preferredHeight: width
|
2024-04-25 09:47:40 +00:00
|
|
|
visible: ((image.status == Image.Loading) ||
|
|
|
|
(image.status == Image.Ready)) &&
|
|
|
|
!image.isError
|
|
|
|
image.source: root.communityIcon
|
|
|
|
}
|
2023-07-04 15:11:41 +00:00
|
|
|
|
2024-04-25 09:47:40 +00:00
|
|
|
StatusBaseText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: root.introMessage || qsTr("Community <b>%1</b> has no intro message...").arg(root.communityName)
|
|
|
|
color: Theme.palette.directColor1
|
2024-04-29 15:39:46 +00:00
|
|
|
wrapMode: Text.Wrap
|
2024-04-25 09:47:40 +00:00
|
|
|
}
|
2023-07-04 15:11:41 +00:00
|
|
|
}
|
2024-04-25 09:47:40 +00:00
|
|
|
}
|
2024-03-27 12:48:17 +00:00
|
|
|
|
2024-04-25 09:47:40 +00:00
|
|
|
CommunityEligibilityTag {
|
|
|
|
id: eligibilityTag
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: Style.current.bigPadding
|
|
|
|
eligibleToJoinAs: d.eligibleToJoinAs
|
|
|
|
isEditMode: root.isEditMode
|
2024-05-16 09:28:06 +00:00
|
|
|
visible: !root.isInvitationPending && !root.checkingPermissionToJoinInProgress && root.joinPermissionsCheckCompletedWithoutErrors &&
|
2024-04-25 09:47:40 +00:00
|
|
|
d.accessType === Constants.communityChatOnRequestAccess
|
2023-02-03 12:27:42 +00:00
|
|
|
}
|
2022-05-26 15:46:02 +00:00
|
|
|
}
|
2023-07-04 15:11:41 +00:00
|
|
|
]
|
2022-05-26 15:46:02 +00:00
|
|
|
}
|