forked from Mirrors/elk
refactor: drop Setup
suffix for setup components
This commit is contained in:
parent
fded94c93d
commit
f165eebed3
9 changed files with 26 additions and 9 deletions
|
@ -57,7 +57,7 @@ function getFieldNameIcon(fieldName: string) {
|
||||||
<AccountAvatar :account="account" w-30 h-30 />
|
<AccountAvatar :account="account" w-30 h-30 />
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<div flex flex-col>
|
<div flex flex-col>
|
||||||
<ContentRichSetup font-bold text-2xl break-words :content="getDisplayName(account)" :emojis="account.emojis" />
|
<ContentRich font-bold text-2xl break-words :content="getDisplayName(account)" :emojis="account.emojis" />
|
||||||
<p op50>
|
<p op50>
|
||||||
{{ getAccountHandle(account) }}
|
{{ getAccountHandle(account) }}
|
||||||
</p>
|
</p>
|
||||||
|
@ -74,7 +74,7 @@ function getFieldNameIcon(fieldName: string) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="account.note">
|
<div v-if="account.note">
|
||||||
<ContentRichSetup text-4 text-gray :content="account.note" :emojis="account.emojis" />
|
<ContentRich text-4 text-gray :content="account.note" :emojis="account.emojis" />
|
||||||
</div>
|
</div>
|
||||||
<div flex flex-wrap gap-4>
|
<div flex flex-wrap gap-4>
|
||||||
<div v-for="field in fields" :key="field.name" flex="~ gap-1" items-center>
|
<div v-for="field in fields" :key="field.name" flex="~ gap-1" items-center>
|
||||||
|
@ -82,7 +82,7 @@ function getFieldNameIcon(fieldName: string) {
|
||||||
<div v-else op50 uppercase text-xs font-bold>
|
<div v-else op50 uppercase text-xs font-bold>
|
||||||
{{ field.name }} |
|
{{ field.name }} |
|
||||||
</div>
|
</div>
|
||||||
<ContentRichSetup text-sm filter-saturate-0 :content="field.value" />
|
<ContentRich text-sm filter-saturate-0 :content="field.value" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div flex gap-5>
|
<div flex gap-5>
|
||||||
|
|
|
@ -22,6 +22,6 @@ defineProps<{
|
||||||
{{ account.followersCount }} Followers
|
{{ account.followersCount }} Followers
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
<ContentRichSetup text-4 text-gray :content="account.note" :emojis="account.emojis" />
|
<ContentRich text-4 text-gray :content="account.note" :emojis="account.emojis" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -19,7 +19,7 @@ const accountHandle = $(useAccountHandle(account, fullServer))
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
<NuxtLink flex flex-col :to="link ? getAccountPath(account) : null">
|
<NuxtLink flex flex-col :to="link ? getAccountPath(account) : null">
|
||||||
<ContentRichSetup font-bold hover:underline :content="getDisplayName(account)" :emojis="account.emojis" />
|
<ContentRich font-bold hover:underline :content="getDisplayName(account)" :emojis="account.emojis" />
|
||||||
<p op35 text-sm>
|
<p op35 text-sm>
|
||||||
{{ accountHandle }}
|
{{ accountHandle }}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -10,6 +10,6 @@ const { link = true } = defineProps<{
|
||||||
<template>
|
<template>
|
||||||
<NuxtLink :to="link ? getAccountPath(account) : undefined" min-w-0 flex gap-1 items-center>
|
<NuxtLink :to="link ? getAccountPath(account) : undefined" min-w-0 flex gap-1 items-center>
|
||||||
<AccountAvatar :account="account" w-5 h-5 />
|
<AccountAvatar :account="account" w-5 h-5 />
|
||||||
<ContentRichSetup hover:underline :content="getDisplayName(account)" :emojis="account.emojis" />
|
<ContentRich hover:underline :content="getDisplayName(account)" :emojis="account.emojis" />
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -8,6 +8,6 @@ defineProps<{
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NuxtLink :to="getAccountPath(account)">
|
<NuxtLink :to="getAccountPath(account)">
|
||||||
<ContentRichSetup font-bold :content="getDisplayName(account)" :emojis="account.emojis" />
|
<ContentRich font-bold :content="getDisplayName(account)" :emojis="account.emojis" />
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -14,7 +14,7 @@ const accountHandle = $(useAccountHandle(account))
|
||||||
:to="link ? getAccountPath(account) : undefined"
|
:to="link ? getAccountPath(account) : undefined"
|
||||||
flex="~ col" min-w-0 md:flex="~ row gap-2" md:items-center
|
flex="~ col" min-w-0 md:flex="~ row gap-2" md:items-center
|
||||||
>
|
>
|
||||||
<ContentRichSetup font-bold break-words hover:underline :content="getDisplayName(account)" :emojis="account.emojis" />
|
<ContentRich font-bold break-words hover:underline :content="getDisplayName(account)" :emojis="account.emojis" />
|
||||||
<p op35 text-sm>
|
<p op35 text-sm>
|
||||||
{{ accountHandle }}
|
{{ accountHandle }}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -9,7 +9,7 @@ const { translation } = useTranslation(status)
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="status-body" whitespace-pre-wrap break-words>
|
<div class="status-body" whitespace-pre-wrap break-words>
|
||||||
<ContentRichSetup
|
<ContentRich
|
||||||
:content="translation.visible ? translation.text : status.content"
|
:content="translation.visible ? translation.text : status.content"
|
||||||
:emojis="status.emojis"
|
:emojis="status.emojis"
|
||||||
/>
|
/>
|
||||||
|
|
16
modules/setup-components.ts
Normal file
16
modules/setup-components.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import { defineNuxtModule, useNuxt } from '@nuxt/kit'
|
||||||
|
|
||||||
|
export default defineNuxtModule({
|
||||||
|
meta: {
|
||||||
|
name: 'setup-components',
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
const nuxt = useNuxt()
|
||||||
|
nuxt.hook('components:extend', (components) => {
|
||||||
|
for (const component of components) {
|
||||||
|
component.pascalName = component.pascalName.replace(/Setup$/, '')
|
||||||
|
component.kebabName = component.kebabName.replace(/-setup$/, '')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
|
@ -6,6 +6,7 @@ export default defineNuxtConfig({
|
||||||
'@pinia/nuxt',
|
'@pinia/nuxt',
|
||||||
'@vue-macros/nuxt',
|
'@vue-macros/nuxt',
|
||||||
'~/modules/purge-comments',
|
'~/modules/purge-comments',
|
||||||
|
'~/modules/setup-components',
|
||||||
],
|
],
|
||||||
experimental: {
|
experimental: {
|
||||||
reactivityTransform: true,
|
reactivityTransform: true,
|
||||||
|
|
Loading…
Reference in a new issue