Skip to content

Commit

Permalink
feat(Community Permissions): Update ENS icon in permission pills
Browse files Browse the repository at this point in the history
Closes #10341
  • Loading branch information
noeliaSD committed Apr 27, 2023
1 parent 87fa7cf commit 8ca70ea
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 18 deletions.
35 changes: 32 additions & 3 deletions storybook/src/Models/PermissionsModel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ QtObject {
available: false
},
{
type: HoldingTypes.Type.Collectible,
key: "Kitty1",
amount: 12,
type: HoldingTypes.Type.Ens,
key: "Ens",
amount: 1,
available: true
}
]
Expand Down Expand Up @@ -151,6 +151,35 @@ QtObject {
}

function createHoldingsModel4() {
return [
{
type: HoldingTypes.Type.Asset,
key: "socks",
amount: 15,
available: true
},
{
type: HoldingTypes.Type.Asset,
key: "snt",
amount: 25000,
available: true
},
{
type: HoldingTypes.Type.Ens,
key: "ENS",
amount: 1,
available: false
},
{
type: HoldingTypes.Type.Asset,
key: "Amp",
amount: 2,
available: true
}
]
}

function createHoldingsModel5() {
return [
{
type: HoldingTypes.Type.Asset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Control {
leftPadding: 2
title: model.text
asset.name: model.imageSource
asset.isImage: !model.isIcon
asset.isImage: true
asset.bgColor: "transparent"
asset.height: 28
asset.width: asset.height
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SortFilterProxyModel {

function getIcon(type, key) {
if (type === HoldingTypes.Type.Ens)
return "username"
return Style.png("tokens/ENS")

const model = type === HoldingTypes.Type.Asset
? assetsModel : collectiblesModel
Expand All @@ -70,19 +70,6 @@ SortFilterProxyModel {
return getIcon(model.type, model.key)
}
},
ExpressionRole {
name: "isIcon"

function isIconType(type) {
return type === HoldingTypes.Type.Ens
}

expression: {
_assetsChanges.revision
_collectiblesChanges.revision
return isIconType(model.type)
}
},
ExpressionRole {
name: "operator"

Expand Down
Binary file added ui/imports/assets/png/tokens/ENS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8ca70ea

Please sign in to comment.