From b32438dc1844991ff39262528fc70880148ba0cd Mon Sep 17 00:00:00 2001 From: Zack Barett Date: Mon, 24 Jan 2022 11:54:00 -0600 Subject: [PATCH] Remove padding (#11417) --- src/dialogs/quick-bar/ha-quick-bar.ts | 51 +++++++++++++++++---------- src/translations/en.json | 3 +- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/dialogs/quick-bar/ha-quick-bar.ts b/src/dialogs/quick-bar/ha-quick-bar.ts index 55b535a847..3695a3e94d 100644 --- a/src/dialogs/quick-bar/ha-quick-bar.ts +++ b/src/dialogs/quick-bar/ha-quick-bar.ts @@ -198,24 +198,32 @@ export class QuickBar extends LitElement { size="small" active >` - : html` - ${scroll({ - items, - layout: Layout1d, - renderItem: (item: QuickBarItem, index) => - this._renderItem(item, index), - })} - `} + : items.length === 0 + ? html` +
+ ${this.hass.localize("ui.dialogs.quick-bar.nothing_found")} +
+ ` + : html` + + ${scroll({ + items, + layout: Layout1d, + renderItem: (item: QuickBarItem, index) => + this._renderItem(item, index), + })} + + `} ${!this._narrow && this._hint ? html`
${this._hint}
` : ""} @@ -673,7 +681,6 @@ export class QuickBar extends LitElement { haStyleDialog, css` .heading { - padding: 8px 20px 0px; display: flex; align-items: center; --mdc-theme-primary: var(--primary-text-color); @@ -746,6 +753,12 @@ export class QuickBar extends LitElement { font-style: italic; text-align: center; } + + .nothing-found { + padding: 16px 0px; + font-size: 16px; + text-align: center; + } `, ]; } diff --git a/src/translations/en.json b/src/translations/en.json index 42786857d5..efd586c6e9 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -628,7 +628,8 @@ }, "filter_placeholder": "Entity Filter", "title": "Quick Search", - "key_c_hint": "Press 'c' on any page to open this search bar" + "key_c_hint": "Press 'c' on any page to open this search bar", + "nothing_found": "Nothing found!" }, "voice_command": { "did_not_hear": "Home Assistant did not hear anything",