Skip to content

Commit 24b61b3

Browse files
committed
refactor(skeleton): service card item
1 parent a5ceff7 commit 24b61b3

File tree

3 files changed

+36
-24
lines changed

3 files changed

+36
-24
lines changed

Diff for: components/Item.vue

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<Suspense>
3+
<template #default>
4+
<Component :is="component" v-bind="props" />
5+
</template>
6+
<template #fallback>
7+
<div class="p-4 flex gap-4">
8+
<div class="animate-pulse">
9+
<div class="w-16 h-16 bg-gray-200 rounded-2xl" />
10+
</div>
11+
<div>
12+
<h3 class="animate-pulse text-lg mt-1">
13+
<span class="inline-block min-h-[1em] w-[110px] flex-auto cursor-wait bg-gray-200 align-middle opacity-50 rounded" />
14+
</h3>
15+
<p class="animate-pulse text-sm text-black/50">
16+
<span class="inline-block min-h-[1em] w-[160px] flex-auto cursor-wait bg-gray-200 align-middle opacity-50 rounded" />
17+
</p>
18+
</div>
19+
</div>
20+
</template>
21+
</Suspense>
22+
</template>
23+
24+
<script setup lang="ts">
25+
import { capitalize } from 'vue'
26+
import type { BaseService } from '~/types'
27+
28+
const props = defineProps<BaseService>()
29+
30+
const type = capitalize(props.type || 'base')
31+
const component = defineAsyncComponent(() => import(`~/components/service/${type}.vue`))
32+
</script>
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div class="p-4 flex gap-4">
33
<div class="flex-shrink-0 flex">
4-
<a :href="link" :title="title" class="self-center">
4+
<a :href="link" :title="title" class="self-center w-16 h-16 overflow-hidden">
55
<slot name="icon">
6-
<ServiceIcon v-bind="icon" />
6+
<img src="http://localhost:8090/icons/authelia.png" :alt="title" class="block bg-contain h-full w-full rounded-2xl border border-black/5">
77
</slot>
88
</a>
99
</div>
@@ -22,15 +22,7 @@
2222
</template>
2323

2424
<script setup lang="ts">
25-
export interface Props {
26-
title: string
27-
description: string
28-
link: string
29-
icon: {
30-
type: 'solid' | 'gradient'
31-
value: string
32-
}
33-
}
25+
import type { BaseService } from '~/types'
3426
35-
defineProps<Props>()
27+
defineProps<BaseService>()
3628
</script>

Diff for: components/service/Icon.vue

-12
This file was deleted.

0 commit comments

Comments
 (0)