fix(ui): display hostname instead of full url (#376)
This commit is contained in:
parent
49a28144fd
commit
468592f59a
|
@ -6,6 +6,7 @@ const prop = defineProps<{
|
||||||
}>()
|
}>()
|
||||||
const alt = $computed(() => `${prop.card.title} - ${prop.card.title}`)
|
const alt = $computed(() => `${prop.card.title} - ${prop.card.title}`)
|
||||||
const isSquare = $computed(() => prop.card.width === prop.card.height)
|
const isSquare = $computed(() => prop.card.width === prop.card.height)
|
||||||
|
const description = $computed(() => prop.card.description ? prop.card.description : new URL(prop.card.url).hostname)
|
||||||
|
|
||||||
// TODO: handle card.type: 'photo' | 'video' | 'rich';
|
// TODO: handle card.type: 'photo' | 'video' | 'rich';
|
||||||
</script>
|
</script>
|
||||||
|
@ -39,11 +40,8 @@ const isSquare = $computed(() => prop.card.width === prop.card.height)
|
||||||
{{ card.providerName }}
|
{{ card.providerName }}
|
||||||
</p>
|
</p>
|
||||||
<strong v-if="card.title" line-clamp-1 text-ellipsis>{{ card.title }}</strong>
|
<strong v-if="card.title" line-clamp-1 text-ellipsis>{{ card.title }}</strong>
|
||||||
<p v-if="card.description" text-secondary line-clamp-2 text-ellipsis>
|
<p v-if="description" text-secondary line-clamp-2 text-ellipsis>
|
||||||
{{ card.description }}
|
{{ description }}
|
||||||
</p>
|
|
||||||
<p v-else text-secondary line-clamp-2 text-ellipsis>
|
|
||||||
{{ card.url }}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
|
Loading…
Reference in a new issue