(pronouns) show slashes short on pronoun list for nameself and emojiself

This commit is contained in:
Valentyne Stigloher 2024-10-07 15:12:12 +02:00
parent 1fedcb3fa9
commit bbc5549184

View File

@ -12,19 +12,15 @@ const config = useConfig();
const visiblePronouns = computed(() => { const visiblePronouns = computed(() => {
return props.pronouns return props.pronouns
.map((pronoun): { pronoun: Pronoun, display?: string } | undefined => { .map((pronoun): Pronoun | undefined => {
if (typeof pronoun === 'string') { if (typeof pronoun === 'string') {
const parsed = buildPronoun(pronounsData, pronoun, config, translator); const parsed = buildPronoun(pronounsData, pronoun, config, translator);
if (parsed) { if (parsed) {
parsed.description = ''; parsed.description = '';
if (pronoun.includes('&')) { return parsed;
return { pronoun: parsed };
} else {
return { pronoun: parsed, display: pronoun };
}
} }
} else if (!pronoun.hidden) { } else if (!pronoun.hidden) {
return { pronoun }; return pronoun;
} }
}) })
.filter((entry) => entry !== undefined); .filter((entry) => entry !== undefined);
@ -39,10 +35,9 @@ const addSlash = (link: string): string => {
<template> <template>
<ul> <ul>
<li v-for="{ pronoun, display } in visiblePronouns" :key="pronoun.canonicalName"> <li v-for="pronoun in visiblePronouns" :key="pronoun.canonicalName">
<nuxt-link :to="addSlash(`${config.pronouns.prefix || ''}/${pronoun.canonicalName}`)"> <nuxt-link :to="addSlash(`${config.pronouns.prefix || ''}/${pronoun.canonicalName}`)">
<strong v-if="display">{{ display }}</strong> <strong><Spelling :text="pronoun.name(glue)" /></strong><small v-if="pronoun.smallForm">/<Spelling :text="pronoun.morphemes[pronoun.smallForm] ?? undefined" /></small>
<strong v-else><Spelling :text="pronoun.name(glue)" /></strong><small v-if="pronoun.smallForm">/<Spelling :text="pronoun.morphemes[pronoun.smallForm] ?? undefined" /></small>
<template v-if="pronoun.description"> <template v-if="pronoun.description">
<small><Spelling :text="pronoun.description as string" /></small> <small><Spelling :text="pronoun.description as string" /></small>