@@ -37,18 +37,7 @@ const batchTwo = computed(() => {
37
37
return contributors .value .slice (mid )
38
38
})
39
39
40
- const discordWidgetSrc = computed (() => {
41
- const widgetId = page .value ?.connect ?.discordWidgetId
42
- const color = useColorMode ().value === ' dark' ? ' light' : ' dark'
43
-
44
- return widgetId ? ` https://discord.com/widget?id=${widgetId }&theme=${color } ` : undefined
45
- })
46
-
47
- const isClient = ref (false )
48
-
49
40
onMounted (async () => {
50
- isClient .value = true
51
-
52
41
try {
53
42
projects .value = dataStore .getProjects ({
54
43
itemsToShow: page .value ?.projects ?.itemsToShow || 6 ,
@@ -250,17 +239,35 @@ onMounted(async () => {
250
239
<UPageSection
251
240
v-if =" page.connect"
252
241
v-bind =" page.connect"
242
+ :ui =" {
243
+ features: 'block'
244
+ }"
253
245
>
254
- <div class =" w-full h-[524px] rounded-lg shadow-2xl ring ring-default overflow-hidden relative" >
255
- <USkeleton class =" absolute inset-0 w-full h-full z-0" />
246
+ <template #features >
247
+ <UButton
248
+ v-if =" page.connect.button"
249
+ v-bind =" page.connect.button"
250
+ class =" bg-[#5865F2]"
251
+ color =" neutral"
252
+ variant =" subtle"
253
+ size =" xl"
254
+ />
255
+ </template >
256
256
257
- <iframe
258
- v-if =" isClient && discordWidgetSrc"
259
- :src =" discordWidgetSrc"
260
- allowtransparency =" true"
261
- frameborder =" 0"
262
- sandbox =" allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
263
- class =" absolute inset-0 w-full h-full z-10 transition-opacity duration-300"
257
+ <div
258
+ class =" w-full h-[524px] rounded-lg shadow-2xl ring ring-default overflow-hidden relative flex items-center justify-center"
259
+ >
260
+ <NuxtImg
261
+ v-if =" page.connect.image && page.connect.image.src"
262
+ :src =" useRuntimeConfig().public.siteUrl + page.connect.image.src"
263
+ :srcset =" useRuntimeConfig().public.siteUrl + page.connect.image.src"
264
+ :alt =" page.connect.image.alt"
265
+ class =" absolute inset-0 w-full h-full object-cover"
266
+ />
267
+
268
+ <USkeleton
269
+ v-else
270
+ class =" absolute inset-0 w-full h-full"
264
271
/>
265
272
</div >
266
273
</UPageSection >
0 commit comments