fix: add placeholder icon for opengraph cards without images (#1131)
This commit is contained in:
parent
44c45d0b64
commit
8549c3a79a
|
@ -46,5 +46,6 @@ module.exports = [
|
||||||
{ id: 'fa-search-plus', src: 'src/thirdparty/font-awesome-svg-png/white/svg/search-plus.svg' },
|
{ id: 'fa-search-plus', src: 'src/thirdparty/font-awesome-svg-png/white/svg/search-plus.svg' },
|
||||||
{ id: 'fa-share-square-o', src: 'src/thirdparty/font-awesome-svg-png/white/svg/share-square-o.svg' },
|
{ id: 'fa-share-square-o', src: 'src/thirdparty/font-awesome-svg-png/white/svg/share-square-o.svg' },
|
||||||
{ id: 'fa-flag', src: 'src/thirdparty/font-awesome-svg-png/white/svg/flag.svg' },
|
{ id: 'fa-flag', src: 'src/thirdparty/font-awesome-svg-png/white/svg/flag.svg' },
|
||||||
{ id: 'fa-suitcase', src: 'src/thirdparty/font-awesome-svg-png/white/svg/suitcase.svg' }
|
{ id: 'fa-suitcase', src: 'src/thirdparty/font-awesome-svg-png/white/svg/suitcase.svg' },
|
||||||
|
{ id: 'fa-file-text', src: 'src/thirdparty/font-awesome-svg-png/white/svg/file-text.svg' }
|
||||||
]
|
]
|
||||||
|
|
|
@ -2,10 +2,13 @@
|
||||||
<strong class="card-title">
|
<strong class="card-title">
|
||||||
{title}
|
{title}
|
||||||
</strong>
|
</strong>
|
||||||
{#if hasBody}
|
{#if description}
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
{#if imageUrl}
|
{#if imageUrl}
|
||||||
<LazyImage forceSize={true} height="50" width="50" src={imageUrl} ariaHidden={true} />
|
<LazyImage forceSize={true} height="50" width="50" src={imageUrl} ariaHidden={true} />
|
||||||
|
{:else}
|
||||||
|
<SvgIcon style="width: 30px; height: 30px; padding: 10px; fill: var(--action-button-deemphasized-fill-color);"
|
||||||
|
href="#fa-file-text" />
|
||||||
{/if}
|
{/if}
|
||||||
{#if description}
|
{#if description}
|
||||||
<span class="card-description">
|
<span class="card-description">
|
||||||
|
@ -73,10 +76,12 @@
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import LazyImage from '../LazyImage'
|
import LazyImage from '../LazyImage.html'
|
||||||
|
import SvgIcon from '../SvgIcon.html'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
SvgIcon,
|
||||||
LazyImage
|
LazyImage
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -84,8 +89,7 @@
|
||||||
title: ({ card }) => card.title,
|
title: ({ card }) => card.title,
|
||||||
url: ({ card }) => card.url,
|
url: ({ card }) => card.url,
|
||||||
description: ({ card }) => card.description || card.provider_name,
|
description: ({ card }) => card.description || card.provider_name,
|
||||||
imageUrl: ({ card }) => card.image,
|
imageUrl: ({ card }) => card.image
|
||||||
hasBody: ({ description, imageUrl }) => description && imageUrl
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue