Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/apps/src/element/selector/SelectAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
<uigc-asset-list>
<uigc-asset-list .isDisabledAssets=${isDisabled}>
<slot slot="footer" name="footer"></slot>
${map(filteredAssets, ({ asset, balance, balanceUsd }) => {
const icons = asset.icon?.split('/') || [asset.symbol]; // TODO fix ext icon
Expand Down
16 changes: 12 additions & 4 deletions packages/ui/src/component/AssetList.ts
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -18,9 +21,14 @@ export class AssetList extends UIGCElement {
</div>
<slot name="selected"></slot>
<slot></slot>
<div class="list-header subheader">
<span>ASSETS WITHOUT PAIR/POOL</span>
</div>
${when(
this.isDisabledAssets,
() => html`
<div class="list-header subheader">
<span>ASSETS WITHOUT PAIR/POOL</span>
</div>
`,
)}
<slot name="disabled"></slot>
<slot name="footer"></slot>
</div>
Expand Down