diff --git a/src/lib/item.js b/src/lib/item.js index 94cf3855..363fe1a2 100644 --- a/src/lib/item.js +++ b/src/lib/item.js @@ -86,7 +86,7 @@ export function getEntrypoints(item) { } export function getDescription(item) { - if (item) { + if (item && item.description) { return item.description; } return ''; diff --git a/src/molecules/gv-card-full/gv-card-full.js b/src/molecules/gv-card-full/gv-card-full.js index 3e60ebff..702a78c7 100644 --- a/src/molecules/gv-card-full/gv-card-full.js +++ b/src/molecules/gv-card-full/gv-card-full.js @@ -134,13 +134,17 @@ export class GvCardFull extends ItemResource(LitElement) { .description { padding: 0 16px; margin: 6px 0; - flex: 1; - flex-grow: 1; max-height: 150px; + flex: 1; overflow: hidden; text-overflow: ellipsis; } + .description * { + display: contents; + font-size: var(--gv-theme-font-size-m, 14px); + } + .infos { display: flex; border-bottom: 1px solid var(--gv-theme-neutral-color-dark, #d9d9d9); @@ -184,6 +188,16 @@ export class GvCardFull extends ItemResource(LitElement) { } } + _getDescription() { + if (this._error) { + return i18n('gv-card-full.error'); + } + if (this._empty) { + return i18n('gv-card-full.empty'); + } + return getDescription(this._item); + } + render() { const title = getTitle(this._item); const owner = getOwner(this._item); @@ -200,12 +214,10 @@ export class GvCardFull extends ItemResource(LitElement) {