feat(@desktop/wallet): Remove network prefixes in Profile, Profile showcase and Profile preview
This commit is contained in:
parent
60fb566580
commit
16a403e3e5
|
@ -40,8 +40,7 @@ SplitView {
|
|||
displayDecimals: 4,
|
||||
stripTrailingZeroes: false}),
|
||||
isAllAccounts: false,
|
||||
path: "m/44’/60’/0’/0’/34",
|
||||
preferredSharingChainIds: walletStore.areTestNetworksEnabled ? "5:420:421613": "1:10:42161"
|
||||
path: "m/44’/60’/0’/0’/34"
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ SplitView {
|
|||
emoji: "🇨🇿"
|
||||
walletType: ""
|
||||
showcaseVisibility: Constants.ShowcaseVisibility.NoOne
|
||||
preferredSharingChainShortNames: "eth:opt:"
|
||||
}
|
||||
ListElement {
|
||||
name: "testing (no emoji, colored, seed)"
|
||||
|
@ -42,7 +41,6 @@ SplitView {
|
|||
emoji: ""
|
||||
walletType: "seed"
|
||||
showcaseVisibility: Constants.ShowcaseVisibility.NoOne
|
||||
preferredSharingChainShortNames: "arb:xdai:"
|
||||
}
|
||||
ListElement {
|
||||
name: "My Bro's Account"
|
||||
|
@ -52,7 +50,6 @@ SplitView {
|
|||
emoji: "🇸🇰"
|
||||
walletType: "watch"
|
||||
showcaseVisibility: Constants.ShowcaseVisibility.NoOne
|
||||
preferredSharingChainShortNames: "eth:opt:"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +65,6 @@ SplitView {
|
|||
walletType: ""
|
||||
showcaseVisibility: Constants.ShowcaseVisibility.Everyone
|
||||
showcasePosition: 0
|
||||
preferredSharingChainShortNames: "eth:opt:"
|
||||
}
|
||||
ListElement {
|
||||
name: "testing (no emoji, colored, seed)"
|
||||
|
@ -79,7 +75,6 @@ SplitView {
|
|||
walletType: "seed"
|
||||
showcaseVisibility: Constants.ShowcaseVisibility.Everyone
|
||||
showcasePosition: 1
|
||||
preferredSharingChainShortNames: "eth:opt:arb:"
|
||||
}
|
||||
ListElement {
|
||||
name: "My Bro's Account"
|
||||
|
@ -90,7 +85,6 @@ SplitView {
|
|||
walletType: "watch"
|
||||
showcaseVisibility: Constants.ShowcaseVisibility.Everyone
|
||||
showcasePosition: 2
|
||||
preferredSharingChainShortNames: "eth:opt:"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ ProfileShowcasePanel {
|
|||
delegate: ProfileShowcasePanelDelegate {
|
||||
title: model ? model.name : ""
|
||||
secondaryTitle: WalletUtils.addressToDisplay(model ? model.address ?? "" : "",
|
||||
model ? model.preferredSharingChainShortNames ?? "" : "",
|
||||
true,
|
||||
containsMouse)
|
||||
hasEmoji: model && !!model.emoji
|
||||
|
@ -35,9 +34,8 @@ ProfileShowcasePanel {
|
|||
expression: {
|
||||
lowerCaseSearchText
|
||||
return (address.toLowerCase().includes(lowerCaseSearchText) ||
|
||||
name.toLowerCase().includes(lowerCaseSearchText) ||
|
||||
preferredSharingChainShortNames.toLowerCase().includes(lowerCaseSearchText))
|
||||
name.toLowerCase().includes(lowerCaseSearchText))
|
||||
}
|
||||
expectedRoles: ["address", "name", "preferredSharingChainShortNames"]
|
||||
expectedRoles: ["address", "name"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,13 +44,6 @@ QtObject {
|
|||
property var ownAccounts: SortFilterProxyModel {
|
||||
sourceModel: root.accounts
|
||||
proxyRoles: [
|
||||
FastExpressionRole {
|
||||
name: "preferredSharingChainShortNames"
|
||||
expression: {
|
||||
return root.networksModuleInst.getNetworkShortNames(model.preferredSharingChainIds)
|
||||
}
|
||||
expectedRoles: ["preferredSharingChainIds"]
|
||||
},
|
||||
FastExpressionRole {
|
||||
name: "color"
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ ColumnLayout {
|
|||
draggable: accountsList.count > 1
|
||||
Drag.keys: [d.walletAccountDnDKey]
|
||||
title: model.name
|
||||
secondaryTitle: WalletUtils.addressToDisplay(model.address, "", true, containsMouse)
|
||||
secondaryTitle: WalletUtils.addressToDisplay(model.address, true, containsMouse)
|
||||
secondaryTitleIcon: model.walletType === Constants.watchWalletType? "show" :
|
||||
model.keycardAccount ? "keycard" : ""
|
||||
hasEmoji: true
|
||||
|
|
|
@ -80,12 +80,12 @@ QtObject {
|
|||
return timestamp + Constants.time.secondsIn7Days
|
||||
}
|
||||
|
||||
function addressToDisplay(address, chainShortNames, shortForm, hovered) {
|
||||
function addressToDisplay(address, shortForm, hovered) {
|
||||
let finalAddress = address
|
||||
if (shortForm) {
|
||||
finalAddress = StatusQUtils.Utils.elideText(address,6,4)
|
||||
}
|
||||
return hovered? WalletUtils.colorizedChainPrefix(chainShortNames) + Utils.richColorText(finalAddress, Theme.palette.directColor1) : chainShortNames + finalAddress
|
||||
return hovered ? Utils.richColorText(finalAddress, Theme.palette.directColor1) : finalAddress
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,6 @@ Control {
|
|||
property string title: ""
|
||||
property string subTitle: ""
|
||||
property string tagIcon: ""
|
||||
property var enabledNetworks
|
||||
property bool loading: false
|
||||
property alias rightSideButtons: rightSideButtonsLoader.sourceComponent
|
||||
signal clicked(var mouse)
|
||||
|
@ -111,29 +110,6 @@ Control {
|
|||
elide: Text.ElideRight
|
||||
}
|
||||
Item { Layout.fillHeight: true }
|
||||
Row {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 20
|
||||
spacing: -4
|
||||
visible: (chainRepeater.count > 0)
|
||||
Repeater {
|
||||
id: chainRepeater
|
||||
model: root.enabledNetworks
|
||||
delegate: StatusRoundedComponent {
|
||||
width: 20
|
||||
height: 20
|
||||
visible: model.iconUrl !== ""
|
||||
color: Theme.palette.baseColor3
|
||||
z: index + 1
|
||||
border.color: Style.current.background
|
||||
StatusIcon {
|
||||
anchors.fill:parent
|
||||
anchors.margins: 1
|
||||
icon: Style.svg(model.iconUrl)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ManageTokensCommunityTag {
|
||||
Layout.preferredWidth: 24
|
||||
|
|
|
@ -59,7 +59,6 @@ Item {
|
|||
asset.letterSize: 14
|
||||
asset.bgColor: Theme.palette.primaryColor3
|
||||
asset.isImage: asset.emoji
|
||||
enabledNetworks: root.walletStore.filteredFlatModel // TODO: https://github.com/status-im/status-desktop/issues/14227
|
||||
rightSideButtons: RowLayout {
|
||||
StatusFlatRoundButton {
|
||||
Layout.preferredWidth: 32
|
||||
|
@ -84,14 +83,12 @@ Item {
|
|||
icon.color: (hovered || d.menuOpened) ? Theme.palette.directColor1 : Theme.palette.baseColor1
|
||||
highlighted: d.menuOpened
|
||||
onClicked: {
|
||||
const preferredChains = StatusQUtils.ModelUtils.modelToArray(accountInfoDelegate.enabledNetworks, ["chainId"]).map((item) => item.chainId).join(":")
|
||||
Global.openMenu(delegatesActionsMenu, this, {
|
||||
x: moreButton.x,
|
||||
y : moreButton.y,
|
||||
accountAddress: model.address,
|
||||
accountName: model.name,
|
||||
accountColorId: model.colorId,
|
||||
accountPrefferedChains: preferredChains
|
||||
accountColorId: model.colorId
|
||||
});
|
||||
}
|
||||
onHoveredChanged: accountInfoDelegate.highlight = hovered
|
||||
|
@ -99,12 +96,10 @@ Item {
|
|||
}
|
||||
onClicked: {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
const preferredChains = StatusQUtils.ModelUtils.modelToArray(accountInfoDelegate.enabledNetworks, ["chainId"]).map((item) => item.chainId).join(":")
|
||||
Global.openMenu(delegatesActionsMenu, this, {
|
||||
accountAddress: model.address,
|
||||
accountName: model.name,
|
||||
accountColorId: model.colorId,
|
||||
accountPrefferedChains: preferredChains
|
||||
accountColorId: model.colorId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +113,6 @@ Item {
|
|||
property string accountAddress: ""
|
||||
property string accountName: ""
|
||||
property string accountColorId: ""
|
||||
property var accountPrefferedChains: []
|
||||
|
||||
onOpened: { d.menuOpened = true; }
|
||||
onClosed: { d.menuOpened = false; }
|
||||
|
@ -140,11 +134,9 @@ Item {
|
|||
Global.openShowQRPopup({
|
||||
showSingleAccount: true,
|
||||
switchingAccounsEnabled: false,
|
||||
changingPreferredChainsEnabled: false,
|
||||
hasFloatingButtons: false,
|
||||
name: contextMenu.accountName,
|
||||
address: contextMenu.accountAddress,
|
||||
preferredSharingChainIds: contextMenu.accountPrefferedChains,
|
||||
colorId: contextMenu.accountColorId
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue