forked from Mirrors/elk
chore: preview header only when it's already set (#1311)
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
a48524e7ad
commit
09997c2f90
1 changed files with 4 additions and 3 deletions
|
@ -20,6 +20,7 @@ const relationship = $(useRelationship(account))
|
||||||
|
|
||||||
const namedFields = ref<mastodon.v1.AccountField[]>([])
|
const namedFields = ref<mastodon.v1.AccountField[]>([])
|
||||||
const iconFields = ref<mastodon.v1.AccountField[]>([])
|
const iconFields = ref<mastodon.v1.AccountField[]>([])
|
||||||
|
const hasHeader = $computed(() => !account.header.endsWith('/original/missing.png'))
|
||||||
|
|
||||||
function getFieldIconTitle(fieldName: string) {
|
function getFieldIconTitle(fieldName: string) {
|
||||||
return fieldName === 'Joined' ? t('account.joined') : fieldName
|
return fieldName === 'Joined' ? t('account.joined') : fieldName
|
||||||
|
@ -85,9 +86,9 @@ const isNotifiedOnPost = $computed(() => !!relationship?.notifying)
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div flex flex-col>
|
<div flex flex-col>
|
||||||
<button border="b base" z-1>
|
<component :is="hasHeader ? 'button' : 'div'" border="b base" z-1 @click="hasHeader ? previewHeader() : undefined">
|
||||||
<img h-50 height="200" w-full object-cover :src="account.header" :alt="t('account.profile_description', [account.username])" @click="previewHeader">
|
<img h-50 height="200" w-full object-cover :src="account.header" :alt="t('account.profile_description', [account.username])">
|
||||||
</button>
|
</component>
|
||||||
<div p4 mt--18 flex flex-col gap-4>
|
<div p4 mt--18 flex flex-col gap-4>
|
||||||
<div relative>
|
<div relative>
|
||||||
<div flex="~ col gap-2 1">
|
<div flex="~ col gap-2 1">
|
||||||
|
|
Loading…
Reference in a new issue