2023-03-20 12:29:05 +00:00
|
|
|
|
import QtQuick 2.15
|
2024-02-12 16:56:59 +00:00
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
2024-03-03 16:34:08 +00:00
|
|
|
|
import StatusQ 0.1
|
2024-02-12 16:56:59 +00:00
|
|
|
|
import StatusQ.Core 0.1
|
2024-10-15 19:26:12 +00:00
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2024-02-12 16:56:59 +00:00
|
|
|
|
import StatusQ.Controls 0.1
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
|
|
import utils 1.0
|
2024-02-12 16:56:59 +00:00
|
|
|
|
import shared.panels 1.0
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
|
|
import AppLayouts.Profile.controls 1.0
|
2024-03-04 22:07:09 +00:00
|
|
|
|
import AppLayouts.Wallet.controls 1.0
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
|
|
ProfileShowcasePanel {
|
|
|
|
|
id: root
|
|
|
|
|
|
2024-02-12 16:56:59 +00:00
|
|
|
|
required property bool addAccountsButtonVisible
|
|
|
|
|
|
|
|
|
|
signal navigateToAccountsTab()
|
|
|
|
|
|
2024-02-15 17:26:05 +00:00
|
|
|
|
emptyInShowcasePlaceholderText: qsTr("Collectibles here will show on your profile")
|
|
|
|
|
emptyHiddenPlaceholderText: qsTr("Collectibles here will be hidden from your profile")
|
2024-03-03 16:34:08 +00:00
|
|
|
|
emptySearchPlaceholderText: qsTr("No collectibles matching search")
|
|
|
|
|
searchPlaceholderText: qsTr("Search collectible name, number, collection or community")
|
2024-02-21 13:39:27 +00:00
|
|
|
|
additionalFooterComponent: root.addAccountsButtonVisible ? addMoreAccountsComponent : null
|
2024-02-12 16:56:59 +00:00
|
|
|
|
|
2024-02-29 09:07:35 +00:00
|
|
|
|
delegate: ProfileShowcasePanelDelegate {
|
2024-03-10 21:31:48 +00:00
|
|
|
|
id: delegate
|
2024-02-28 12:19:14 +00:00
|
|
|
|
title: !!model ? `${model.name}` || `#${model.id}` : ""
|
|
|
|
|
secondaryTitle: !!model && !!model.collectionName ? model.collectionName : ""
|
|
|
|
|
hasImage: !!model && !!model.imageUrl
|
|
|
|
|
|
|
|
|
|
icon.source: hasImage ? model.imageUrl : ""
|
2024-10-15 19:26:12 +00:00
|
|
|
|
bgRadius: Theme.radius
|
2024-02-28 12:19:14 +00:00
|
|
|
|
assetBgColor: !!model && !!model.backgroundColor ? model.backgroundColor : "transparent"
|
|
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
|
actionComponent: model && !!model.communityId ? communityTokenTagComponent : null
|
2024-03-10 21:31:48 +00:00
|
|
|
|
showcaseMaxVisibility: model ? model.maxVisibility : Constants.ShowcaseVisibility.Everyone
|
|
|
|
|
onShowcaseMaxVisibilityChanged: {
|
|
|
|
|
if (delegate.showcaseVisibility > delegate.showcaseMaxVisibility) {
|
|
|
|
|
root.setVisibilityRequested(delegate.key, delegate.showcaseMaxVisibility)
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-04 22:07:09 +00:00
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: communityTokenTagComponent
|
|
|
|
|
ManageTokensCommunityTag {
|
2024-02-13 11:12:01 +00:00
|
|
|
|
communityName: model && !!model.communityName ? model.communityName : ""
|
|
|
|
|
communityId: model && !!model.communityId ? model.communityId : ""
|
|
|
|
|
communityImage: model && !!model.communityImage ? model.communityImage : ""
|
2024-03-04 22:07:09 +00:00
|
|
|
|
loading: model && !!model.communityImageLoading ? model.communityImageLoading : false
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-28 12:19:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-04-19 09:46:23 +00:00
|
|
|
|
filter: FastExpressionFilter {
|
|
|
|
|
readonly property string lowerCaseSearchText: root.searcherText.toLowerCase()
|
|
|
|
|
expression: {
|
|
|
|
|
lowerCaseSearchText
|
|
|
|
|
return (name.toLowerCase().includes(lowerCaseSearchText) ||
|
|
|
|
|
uid.toLowerCase().includes(lowerCaseSearchText) ||
|
|
|
|
|
(!!communityName && communityName.toLowerCase().includes(lowerCaseSearchText)) ||
|
|
|
|
|
(!!collectionName && collectionName.toLowerCase().includes(lowerCaseSearchText)))
|
|
|
|
|
}
|
|
|
|
|
expectedRoles: ["name", "uid", "collectionName", "communityName"]
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-21 13:39:27 +00:00
|
|
|
|
Component {
|
|
|
|
|
id: addMoreAccountsComponent
|
2024-02-12 16:56:59 +00:00
|
|
|
|
|
2024-02-21 13:39:27 +00:00
|
|
|
|
AddMoreAccountsLink {
|
2024-03-03 16:34:08 +00:00
|
|
|
|
visible: root.addAccountsButtonVisible
|
|
|
|
|
text: qsTr("Don’t see some of your collectibles?")
|
|
|
|
|
onClicked: root.navigateToAccountsTab()
|
2024-02-21 13:39:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-20 12:29:05 +00:00
|
|
|
|
}
|