From 75af2078e134f7707b7f758f24982fca9a2536c4 Mon Sep 17 00:00:00 2001 From: vkulinich Date: Wed, 24 Jul 2024 14:06:37 +0200 Subject: [PATCH] Hide asset selector subheader --- .../apps/src/element/selector/SelectAsset.ts | 6 +++++- packages/ui/src/component/AssetList.ts | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/packages/apps/src/element/selector/SelectAsset.ts b/packages/apps/src/element/selector/SelectAsset.ts index 3516722ecf..c75d8717ae 100644 --- a/packages/apps/src/element/selector/SelectAsset.ts +++ b/packages/apps/src/element/selector/SelectAsset.ts @@ -210,10 +210,14 @@ export class SelectAsset extends LitElement { render() { const filteredAssets = this.filter(this.query); + const isDisabled = filteredAssets.some(({ asset }) => + this.isDisabled(asset), + ); + const assets = filteredAssets.length > 0 ? () => html` - + ${map(filteredAssets, ({ asset, balance, balanceUsd }) => { const icons = asset.icon?.split('/') || [asset.symbol]; // TODO fix ext icon diff --git a/packages/ui/src/component/AssetList.ts b/packages/ui/src/component/AssetList.ts index 226d46ca2b..d292c2cdd3 100644 --- a/packages/ui/src/component/AssetList.ts +++ b/packages/ui/src/component/AssetList.ts @@ -1,12 +1,15 @@ import { html } from 'lit'; -import { customElement } from 'lit/decorators.js'; +import { customElement, property } from 'lit/decorators.js'; import { UIGCElement } from './base/UIGCElement'; import styles from './AssetList.css'; +import { when } from 'lit/directives/when'; @customElement('uigc-asset-list') export class AssetList extends UIGCElement { + @property({ type: Boolean }) isDisabledAssets = false; + static styles = [UIGCElement.styles, styles]; render() { @@ -18,9 +21,14 @@ export class AssetList extends UIGCElement { -
- ASSETS WITHOUT PAIR/POOL -
+ ${when( + this.isDisabledAssets, + () => html` +
+ ASSETS WITHOUT PAIR/POOL +
+ `, + )}