2020-07-21 21:03:22 +00:00
|
|
|
import QtQuick 2.13
|
2022-03-28 09:38:58 +00:00
|
|
|
import QtQuick.Controls 2.3
|
2020-07-21 21:03:22 +00:00
|
|
|
import QtQuick.Layouts 1.13
|
2024-03-03 16:34:08 +00:00
|
|
|
import QtQml 2.15
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
2024-01-13 03:24:57 +00:00
|
|
|
import shared.stores 1.0
|
2022-03-16 21:20:03 +00:00
|
|
|
import shared.controls.chat 1.0
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
import "../popups"
|
2021-12-30 12:39:47 +00:00
|
|
|
import "../stores"
|
2022-06-22 12:16:21 +00:00
|
|
|
import "../controls"
|
|
|
|
import "./profile"
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
2021-09-09 14:03:17 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2024-02-28 12:19:14 +00:00
|
|
|
import StatusQ.Core.Utils 0.1
|
2021-09-09 14:03:17 +00:00
|
|
|
import StatusQ.Components 0.1
|
2021-10-18 10:34:16 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2021-09-09 14:03:17 +00:00
|
|
|
|
2024-02-28 12:19:14 +00:00
|
|
|
import AppLayouts.Profile.helpers 1.0
|
2024-02-04 11:50:26 +00:00
|
|
|
import AppLayouts.Profile.panels 1.0
|
2024-01-13 03:24:57 +00:00
|
|
|
import AppLayouts.Wallet.stores 1.0
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
SettingsContentBase {
|
2021-10-06 09:16:39 +00:00
|
|
|
id: root
|
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
property ProfileStore profileStore
|
2022-09-27 21:26:26 +00:00
|
|
|
property ContactsStore contactsStore
|
2024-01-13 03:24:57 +00:00
|
|
|
|
2024-03-29 11:43:49 +00:00
|
|
|
property bool sendToAccountEnabled: false
|
|
|
|
|
|
|
|
property alias communitiesShowcaseModel: showcaseModels.communitiesSourceModel
|
|
|
|
property alias accountsShowcaseModel: showcaseModels.accountsSourceModel
|
|
|
|
property alias collectiblesShowcaseModel: showcaseModels.collectiblesSourceModel
|
|
|
|
property alias socialLinksShowcaseModel: showcaseModels.socialLinksSourceModel
|
2022-06-22 12:16:21 +00:00
|
|
|
|
2024-02-15 09:25:40 +00:00
|
|
|
property var assetsModel
|
|
|
|
property var collectiblesModel
|
|
|
|
|
2024-02-07 09:54:45 +00:00
|
|
|
property bool sideBySidePreview
|
2024-03-15 16:10:42 +00:00
|
|
|
property bool toastClashesWithDirtyBubble
|
2024-03-29 11:43:49 +00:00
|
|
|
readonly property alias sideBySidePreviewComponent: myProfilePreviewComponent
|
2024-02-07 09:54:45 +00:00
|
|
|
|
2024-03-29 11:43:49 +00:00
|
|
|
readonly property QtObject liveValues: QtObject {
|
|
|
|
readonly property string displayName: descriptionPanel.displayName.text
|
|
|
|
readonly property string bio: descriptionPanel.bio.text
|
|
|
|
readonly property url profileLargeImage: profileHeader.previewIcon
|
2024-02-07 09:54:45 +00:00
|
|
|
}
|
|
|
|
|
2024-02-23 09:22:50 +00:00
|
|
|
enum TabIndex {
|
|
|
|
Identity = 0,
|
|
|
|
Communities = 1,
|
|
|
|
Accounts = 2,
|
|
|
|
Collectibles = 3,
|
2024-03-04 22:07:09 +00:00
|
|
|
//Assets = 4,
|
2024-02-28 11:59:18 +00:00
|
|
|
Web = 4
|
2024-02-23 09:22:50 +00:00
|
|
|
}
|
|
|
|
|
2024-02-07 09:54:45 +00:00
|
|
|
titleRowComponentLoader.sourceComponent: StatusButton {
|
|
|
|
text: qsTr("Preview")
|
|
|
|
onClicked: Global.openPopup(profilePreview)
|
|
|
|
visible: !root.sideBySidePreview
|
2022-06-22 12:16:21 +00:00
|
|
|
}
|
|
|
|
|
2024-03-08 20:11:48 +00:00
|
|
|
dirty: priv.isIdentityTabDirty ||
|
2024-02-15 18:58:54 +00:00
|
|
|
priv.hasAnyProfileShowcaseChanges
|
2024-05-20 21:13:55 +00:00
|
|
|
saveChangesButtonEnabled: !!descriptionPanel.displayName.text && descriptionPanel.displayName.valid && (descriptionPanel.bio.valid || descriptionPanel.bio.text === '')
|
2022-06-22 12:16:21 +00:00
|
|
|
|
2024-03-12 15:44:27 +00:00
|
|
|
toast.saveChangesTooltipText: saveChangesButtonEnabled ? "" : qsTr("Invalid changes made to Identity")
|
2024-03-04 12:41:54 +00:00
|
|
|
autoscrollWhenDirty: profileTabBar.currentIndex === MyProfileView.Identity
|
2024-03-14 16:38:30 +00:00
|
|
|
toast.loading: priv.expectedBackendResponses > 0
|
2024-03-15 16:10:42 +00:00
|
|
|
toast.additionalComponent.visible: false // TODO:Issue #13997 // !toast.loading && root.toastClashesWithDirtyBubble && priv.saveRequestFailed
|
|
|
|
toast.additionalComponent.text: qsTr("Changes could not be saved. Try again")
|
|
|
|
toast.additionalComponent.color: Theme.palette.dangerColor1
|
|
|
|
|
2024-02-04 11:50:26 +00:00
|
|
|
onResetChangesClicked: priv.reset()
|
|
|
|
|
|
|
|
onSaveChangesClicked: priv.save()
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2022-10-20 13:41:18 +00:00
|
|
|
bottomHeaderComponents: StatusTabBar {
|
2024-02-04 11:50:26 +00:00
|
|
|
id: profileTabBar
|
|
|
|
|
2022-10-20 13:41:18 +00:00
|
|
|
StatusTabButton {
|
2024-02-09 04:05:14 +00:00
|
|
|
objectName: "identityTabButton"
|
2024-02-04 11:50:26 +00:00
|
|
|
width: implicitWidth
|
2023-09-22 09:58:02 +00:00
|
|
|
leftPadding: 0
|
2024-02-04 11:50:26 +00:00
|
|
|
text: qsTr("Identity")
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusTabButton {
|
2024-02-09 04:05:14 +00:00
|
|
|
objectName: "communitiesTabButton"
|
2022-10-20 13:41:18 +00:00
|
|
|
width: implicitWidth
|
2024-02-04 11:50:26 +00:00
|
|
|
text: qsTr("Communities")
|
2022-10-20 13:41:18 +00:00
|
|
|
}
|
2024-02-04 11:50:26 +00:00
|
|
|
|
2022-10-20 13:41:18 +00:00
|
|
|
StatusTabButton {
|
2024-02-09 04:05:14 +00:00
|
|
|
objectName: "accountsTabButton"
|
2022-10-20 13:41:18 +00:00
|
|
|
width: implicitWidth
|
2024-02-04 11:50:26 +00:00
|
|
|
text: qsTr("Accounts")
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusTabButton {
|
2024-02-09 04:05:14 +00:00
|
|
|
objectName: "collectiblesTabButton"
|
2024-02-04 11:50:26 +00:00
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Collectibles")
|
|
|
|
}
|
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
// TODO: Uncomment when assets tab is implemented
|
|
|
|
// StatusTabButton {
|
|
|
|
// objectName: "assetsTabButton"
|
|
|
|
// width: implicitWidth
|
|
|
|
// text: qsTr("Assets")
|
|
|
|
// }
|
|
|
|
|
2024-02-04 11:50:26 +00:00
|
|
|
StatusTabButton {
|
2024-02-09 04:05:14 +00:00
|
|
|
objectName: "webTabButton"
|
2024-02-04 11:50:26 +00:00
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Web")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onVisibleChanged: if (visible) profileStore.requestProfileShowcasePreferences()
|
|
|
|
Component.onCompleted: profileStore.requestProfileShowcasePreferences()
|
|
|
|
|
2024-03-29 11:43:49 +00:00
|
|
|
property QObject priv: QObject {
|
2024-02-04 11:50:26 +00:00
|
|
|
id: priv
|
|
|
|
|
2024-03-14 16:38:30 +00:00
|
|
|
readonly property bool hasAnyProfileShowcaseChanges: showcaseModels.dirty
|
|
|
|
readonly property bool isIdentityTabDirty: (!descriptionPanel.isEnsName &&
|
|
|
|
descriptionPanel.displayName.text !== profileStore.displayName) ||
|
|
|
|
descriptionPanel.bio.text !== profileStore.bio ||
|
|
|
|
profileStore.socialLinksDirty ||
|
|
|
|
profileHeader.icon !== profileStore.profileLargeImage
|
2024-02-28 12:19:14 +00:00
|
|
|
|
|
|
|
property ProfileShowcaseModels showcaseModels: ProfileShowcaseModels {
|
2024-03-29 11:43:49 +00:00
|
|
|
id: showcaseModels
|
2024-02-28 12:19:14 +00:00
|
|
|
}
|
2024-02-04 11:50:26 +00:00
|
|
|
|
2024-03-14 16:38:30 +00:00
|
|
|
// Used to track which are the expected backend responses (they can be 0, 1 or 2) depending on the dirty changes
|
|
|
|
property int expectedBackendResponses: 0
|
|
|
|
property bool saveRequestFailed: false
|
|
|
|
|
|
|
|
// Maximum save action waiting time controller.
|
|
|
|
// Backend response must be received before, otherwise it will be considered
|
|
|
|
// a failure and UI will be released.
|
|
|
|
property Timer saveLoadingTimeout : Timer {
|
|
|
|
interval: 5000
|
|
|
|
repeat: false
|
|
|
|
running: toast.active && toast.loading
|
|
|
|
|
|
|
|
onTriggered: {
|
|
|
|
// Forcing a failure
|
|
|
|
if(priv.expectedBackendResponses > 0) {
|
|
|
|
root.profileStore.profileSettingsSaveFailed()
|
|
|
|
priv.expectedBackendResponses = 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Save backend response received:
|
|
|
|
property Connections profileStoreConnection: Connections {
|
|
|
|
target: root.profileStore
|
|
|
|
|
|
|
|
function onProfileIdentitySaveSucceeded() {
|
|
|
|
priv.checkSaveResult(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
function onProfileIdentitySaveFailed() {
|
|
|
|
priv.checkSaveResult(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
function onProfileShowcasePreferencesSaveSucceeded() {
|
|
|
|
priv.checkSaveResult(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
function onProfileShowcasePreferencesSaveFailed() {
|
|
|
|
priv.checkSaveResult(true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkSaveResult(isFailure) {
|
|
|
|
priv.expectedBackendResponses--
|
|
|
|
if(isFailure)
|
|
|
|
priv.saveRequestFailed = isFailure
|
|
|
|
|
|
|
|
if(priv.expectedBackendResponses == 0) {
|
|
|
|
if(priv.saveRequestFailed || isFailure) {
|
|
|
|
root.profileStore.profileSettingsSaveFailed()
|
|
|
|
} else {
|
|
|
|
root.profileStore.profileSettingsSaveSucceeded()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-04 11:50:26 +00:00
|
|
|
function reset() {
|
|
|
|
descriptionPanel.displayName.text = Qt.binding(() => { return profileStore.displayName })
|
|
|
|
descriptionPanel.bio.text = Qt.binding(() => { return profileStore.bio })
|
|
|
|
profileStore.resetSocialLinks()
|
|
|
|
profileHeader.icon = Qt.binding(() => { return profileStore.profileLargeImage })
|
|
|
|
|
2024-02-28 12:19:14 +00:00
|
|
|
priv.showcaseModels.revert()
|
2024-03-14 16:38:30 +00:00
|
|
|
priv.saveRequestFailed = false
|
|
|
|
priv.expectedBackendResponses = 0
|
2024-02-04 11:50:26 +00:00
|
|
|
root.profileStore.requestProfileShowcasePreferences()
|
|
|
|
}
|
|
|
|
|
|
|
|
function save() {
|
2024-03-14 16:38:30 +00:00
|
|
|
// IMPORTANT: Save implies 2 calls in backend but 1 result in UI so the order in current save method is relevant
|
|
|
|
// First save stage: Review which are the expected responses before calling backend
|
|
|
|
priv.expectedBackendResponses = 0
|
|
|
|
priv.saveRequestFailed = false
|
|
|
|
if(hasAnyProfileShowcaseChanges) {
|
|
|
|
priv.expectedBackendResponses++
|
|
|
|
}
|
|
|
|
if (isIdentityTabDirty ) {
|
|
|
|
priv.expectedBackendResponses++
|
2024-03-13 09:46:40 +00:00
|
|
|
}
|
2024-03-08 20:11:48 +00:00
|
|
|
|
2024-03-14 16:38:30 +00:00
|
|
|
// Second save stage: Ready to call backend
|
|
|
|
if(priv.expectedBackendResponses > 0) {
|
|
|
|
// Accounts, Communities, Assets, Collectibles and social links info
|
|
|
|
if (hasAnyProfileShowcaseChanges) {
|
|
|
|
root.profileStore.saveProfileShowcasePreferences(showcaseModels.buildJSONModelsCurrentState())
|
|
|
|
}
|
|
|
|
|
2024-05-02 15:14:55 +00:00
|
|
|
// Identity info. Update only those fields that have changed
|
2024-03-14 16:38:30 +00:00
|
|
|
if (isIdentityTabDirty) {
|
2024-05-02 15:14:55 +00:00
|
|
|
const imageChanged = profileHeader.icon !== profileStore.profileLargeImage
|
|
|
|
const displayNameChanged = descriptionPanel.displayName.text !== profileStore.displayName
|
|
|
|
const bioChanged = descriptionPanel.bio.text.trim() !== profileStore.bio.trim()
|
|
|
|
|
|
|
|
root.profileStore.saveProfileIdentityChanges(
|
|
|
|
displayNameChanged ? descriptionPanel.displayName.text : undefined,
|
|
|
|
bioChanged ? descriptionPanel.bio.text.trim() : undefined,
|
|
|
|
imageChanged ? {
|
|
|
|
source : profileHeader.icon,
|
|
|
|
aX: profileHeader.cropRect.x,
|
|
|
|
aY: profileHeader.cropRect.y,
|
|
|
|
bX: profileHeader.cropRect.x + profileHeader.cropRect.width,
|
|
|
|
bY: profileHeader.cropRect.y + profileHeader.cropRect.height
|
|
|
|
} : undefined
|
|
|
|
)
|
2024-03-14 16:38:30 +00:00
|
|
|
profileHeader.icon = Qt.binding(() => { return profileStore.profileLargeImage })
|
|
|
|
}
|
2024-03-13 09:46:40 +00:00
|
|
|
}
|
2022-10-20 13:41:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-15 18:58:54 +00:00
|
|
|
StackLayout {
|
|
|
|
id: stackLayout
|
|
|
|
|
2024-03-03 12:06:52 +00:00
|
|
|
width: root.contentWidth
|
|
|
|
height: profileTabBar.currentIndex === MyProfileView.Web ? implicitHeight : root.contentHeight
|
2024-02-15 18:58:54 +00:00
|
|
|
currentIndex: profileTabBar.currentIndex
|
|
|
|
|
2024-02-23 09:22:50 +00:00
|
|
|
onCurrentIndexChanged: {
|
|
|
|
if(root.profileStore.isFirstShowcaseInteraction && currentIndex !== MyProfileView.TabIndex.Identity) {
|
|
|
|
root.profileStore.setIsFirstShowcaseInteraction()
|
|
|
|
Global.openPopup(profileShowcaseInfoPopup)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-15 18:58:54 +00:00
|
|
|
// identity
|
|
|
|
ColumnLayout {
|
|
|
|
objectName: "myProfileSettingsView"
|
|
|
|
ProfileHeader {
|
|
|
|
id: profileHeader
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: Style.current.padding
|
|
|
|
Layout.rightMargin: Style.current.padding
|
|
|
|
|
|
|
|
store: root.profileStore
|
|
|
|
|
|
|
|
displayName: profileStore.name
|
|
|
|
pubkey: profileStore.pubkey
|
|
|
|
icon: profileStore.profileLargeImage
|
|
|
|
imageSize: ProfileHeader.ImageSize.Big
|
|
|
|
|
|
|
|
displayNameVisible: false
|
|
|
|
pubkeyVisible: false
|
|
|
|
emojiHashVisible: false
|
|
|
|
editImageButtonVisible: true
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
2022-03-16 21:20:03 +00:00
|
|
|
|
2024-02-15 18:58:54 +00:00
|
|
|
ProfileDescriptionPanel {
|
|
|
|
id: descriptionPanel
|
2024-02-04 11:50:26 +00:00
|
|
|
|
2024-02-15 18:58:54 +00:00
|
|
|
readonly property bool isEnsName: profileStore.preferredName
|
2024-02-04 11:50:26 +00:00
|
|
|
|
2024-02-15 18:58:54 +00:00
|
|
|
Layout.fillWidth: true
|
2024-02-12 16:56:59 +00:00
|
|
|
|
2024-02-15 18:58:54 +00:00
|
|
|
displayName.focus: !isEnsName
|
|
|
|
displayName.input.edit.readOnly: isEnsName
|
|
|
|
displayName.text: profileStore.name
|
|
|
|
displayName.validationMode: StatusInput.ValidationMode.Always
|
|
|
|
displayName.validators: isEnsName ? [] : Constants.validators.displayName
|
|
|
|
bio.text: profileStore.bio
|
2024-02-04 11:50:26 +00:00
|
|
|
}
|
2024-02-15 18:58:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// communities
|
|
|
|
ProfileShowcaseCommunitiesPanel {
|
|
|
|
id: profileShowcaseCommunitiesPanel
|
2024-02-28 12:19:14 +00:00
|
|
|
inShowcaseModel: priv.showcaseModels.communitiesVisibleModel
|
2024-03-03 16:34:08 +00:00
|
|
|
hiddenModel: priv.showcaseModels.communitiesHiddenModel
|
2024-03-08 20:11:48 +00:00
|
|
|
showcaseLimit: root.profileStore.getProfileShowcaseEntriesLimit()
|
2024-02-28 12:19:14 +00:00
|
|
|
|
2024-02-29 07:43:38 +00:00
|
|
|
onChangePositionRequested: function (from, to) {
|
|
|
|
priv.showcaseModels.changeCommunityPosition(from, to)
|
2024-02-28 12:19:14 +00:00
|
|
|
}
|
|
|
|
onSetVisibilityRequested: function (key, toVisibility) {
|
|
|
|
priv.showcaseModels.setCommunityVisibility(key, toVisibility)
|
|
|
|
}
|
2024-02-15 18:58:54 +00:00
|
|
|
}
|
2024-02-04 11:50:26 +00:00
|
|
|
|
2024-02-15 18:58:54 +00:00
|
|
|
// accounts
|
|
|
|
ProfileShowcaseAccountsPanel {
|
|
|
|
id: profileShowcaseAccountsPanel
|
2024-02-28 12:19:14 +00:00
|
|
|
inShowcaseModel: priv.showcaseModels.accountsVisibleModel
|
|
|
|
hiddenModel: priv.showcaseModels.accountsHiddenModel
|
2024-03-08 20:11:48 +00:00
|
|
|
showcaseLimit: root.profileStore.getProfileShowcaseEntriesLimit()
|
2024-04-05 16:39:08 +00:00
|
|
|
currentWallet: RootStore.overview.mixedcaseAddress
|
2024-02-28 12:19:14 +00:00
|
|
|
|
2024-02-29 07:43:38 +00:00
|
|
|
onChangePositionRequested: function (from, to) {
|
|
|
|
priv.showcaseModels.changeAccountPosition(from, to)
|
2024-03-14 16:38:30 +00:00
|
|
|
|
2024-02-28 12:19:14 +00:00
|
|
|
}
|
|
|
|
onSetVisibilityRequested: function (key, toVisibility) {
|
|
|
|
priv.showcaseModels.setAccountVisibility(key, toVisibility)
|
|
|
|
}
|
2024-02-15 18:58:54 +00:00
|
|
|
}
|
2024-02-09 11:05:51 +00:00
|
|
|
|
2024-02-15 18:58:54 +00:00
|
|
|
// collectibles
|
|
|
|
ProfileShowcaseCollectiblesPanel {
|
|
|
|
id: profileShowcaseCollectiblesPanel
|
2024-02-28 12:19:14 +00:00
|
|
|
inShowcaseModel: priv.showcaseModels.collectiblesVisibleModel
|
|
|
|
hiddenModel: priv.showcaseModels.collectiblesHiddenModel
|
2024-03-08 20:11:48 +00:00
|
|
|
showcaseLimit: root.profileStore.getProfileShowcaseEntriesLimit()
|
2024-03-04 22:07:09 +00:00
|
|
|
addAccountsButtonVisible: priv.showcaseModels.accountsHiddenModel.count > 0
|
|
|
|
|
|
|
|
onNavigateToAccountsTab: profileTabBar.currentIndex = MyProfileView.TabIndex.Accounts
|
|
|
|
|
2024-02-29 07:43:38 +00:00
|
|
|
onChangePositionRequested: function (from, to) {
|
|
|
|
priv.showcaseModels.changeCollectiblePosition(from, to)
|
2024-02-28 12:19:14 +00:00
|
|
|
}
|
2022-11-11 16:46:35 +00:00
|
|
|
|
2024-02-28 12:19:14 +00:00
|
|
|
onSetVisibilityRequested: function (key, toVisibility) {
|
|
|
|
priv.showcaseModels.setCollectibleVisibility(key, toVisibility)
|
|
|
|
}
|
2024-02-15 18:58:54 +00:00
|
|
|
}
|
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
// assets
|
|
|
|
// TODO: Integrate the assets tab with the new backend
|
|
|
|
// ProfileShowcaseAssetsPanel {
|
|
|
|
// id: profileShowcaseAssetsPanel
|
|
|
|
|
|
|
|
// baseModel: root.walletAssetsStore.groupedAccountAssetsModel // TODO: instantiate an assets model in profile module
|
2024-03-29 11:43:49 +00:00
|
|
|
// showcaseModel: root.contactsStore.showcaseContactAssetsModel
|
|
|
|
// addAccountsButtonVisible: root.contactsStore.showcaseContactAccountsModel.hiddenCount > 0
|
2024-03-04 22:07:09 +00:00
|
|
|
// formatCurrencyAmount: function(amount, symbol) {
|
|
|
|
// return root.currencyStore.formatCurrencyAmount(amount, symbol)
|
|
|
|
// }
|
|
|
|
|
|
|
|
// onShowcaseEntryChanged: priv.hasAnyProfileShowcaseChanges = true
|
|
|
|
// onNavigateToAccountsTab: profileTabBar.currentIndex = MyProfileView.TabIndex.Accounts
|
|
|
|
// }
|
|
|
|
|
2024-02-15 18:58:54 +00:00
|
|
|
// web
|
|
|
|
ProfileSocialLinksPanel {
|
2024-03-08 20:11:48 +00:00
|
|
|
showcaseLimit: root.profileStore.getProfileShowcaseSocialLinksLimit()
|
2024-03-08 09:27:45 +00:00
|
|
|
socialLinksModel: priv.showcaseModels.socialLinksVisibleModel
|
|
|
|
|
|
|
|
onAddSocialLink: function(url, text) {
|
|
|
|
priv.showcaseModels.appendSocialLink({ showcaseKey: "", text: text, url: url })
|
|
|
|
}
|
|
|
|
|
|
|
|
onUpdateSocialLink: function(index, url, text) {
|
|
|
|
priv.showcaseModels.updateSocialLink(index, { text: text, url: url })
|
|
|
|
}
|
|
|
|
|
|
|
|
onRemoveSocialLink: function(index) {
|
|
|
|
priv.showcaseModels.removeSocialLink(index)
|
|
|
|
}
|
|
|
|
|
|
|
|
onChangePosition: function(from, to) {
|
|
|
|
priv.showcaseModels.changeSocialLinkPosition(from, to)
|
|
|
|
}
|
2024-02-15 18:58:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: profilePreview
|
|
|
|
ProfileDialog {
|
|
|
|
publicKey: root.contactsStore.myPublicKey
|
|
|
|
profileStore: root.profileStore
|
|
|
|
contactsStore: root.contactsStore
|
2024-03-29 11:43:49 +00:00
|
|
|
sendToAccountEnabled: root.sendToAccountEnabled
|
2024-02-15 18:58:54 +00:00
|
|
|
onClosed: destroy()
|
2024-03-29 11:43:49 +00:00
|
|
|
dirtyValues: root.liveValues
|
|
|
|
dirty: root.dirty
|
|
|
|
|
|
|
|
showcaseCommunitiesModel: priv.showcaseModels.communitiesVisibleModel
|
|
|
|
showcaseAccountsModel: priv.showcaseModels.accountsVisibleModel
|
|
|
|
showcaseCollectiblesModel: priv.showcaseModels.collectiblesVisibleModel
|
|
|
|
showcaseSocialLinksModel: priv.showcaseModels.socialLinksVisibleModel
|
|
|
|
//showcaseAssetsModel: priv.showcaseModels.assetsVisibleModel
|
2024-02-15 09:25:40 +00:00
|
|
|
|
|
|
|
assetsModel: root.assetsModel
|
|
|
|
collectiblesModel: root.collectiblesModel
|
2024-03-29 11:43:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: myProfilePreviewComponent
|
|
|
|
MyProfilePreview {
|
|
|
|
profileStore: root.profileStore
|
|
|
|
contactsStore: root.contactsStore
|
|
|
|
sendToAccountEnabled: root.sendToAccountEnabled
|
|
|
|
dirtyValues: root.liveValues
|
2024-03-14 17:31:38 +00:00
|
|
|
dirty: root.dirty
|
2024-03-29 11:43:49 +00:00
|
|
|
|
|
|
|
showcaseCommunitiesModel: priv.showcaseModels.communitiesVisibleModel
|
|
|
|
showcaseAccountsModel: priv.showcaseModels.accountsVisibleModel
|
|
|
|
showcaseCollectiblesModel: priv.showcaseModels.collectiblesVisibleModel
|
|
|
|
showcaseSocialLinksModel: priv.showcaseModels.socialLinksVisibleModel
|
|
|
|
//showcaseAssetsModel: priv.showcaseModels.assetsVisibleModel
|
2024-02-15 09:25:40 +00:00
|
|
|
|
|
|
|
assetsModel: root.assetsModel
|
|
|
|
collectiblesModel: root.collectiblesModel
|
2024-02-04 11:50:26 +00:00
|
|
|
}
|
2020-08-19 21:01:22 +00:00
|
|
|
}
|
2024-02-23 09:22:50 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: profileShowcaseInfoPopup
|
|
|
|
|
|
|
|
ProfileShowcaseInfoPopup {
|
|
|
|
destroyOnClose: true
|
|
|
|
}
|
|
|
|
}
|
2020-08-19 21:01:22 +00:00
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|