@@ -37,18 +37,7 @@ const batchTwo = computed(() => {
3737 return contributors .value .slice (mid )
3838})
3939
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-
4940onMounted (async () => {
50- isClient .value = true
51-
5241 try {
5342 projects .value = dataStore .getProjects ({
5443 itemsToShow: page .value ?.projects ?.itemsToShow || 6 ,
@@ -250,17 +239,35 @@ onMounted(async () => {
250239 <UPageSection
251240 v-if =" page.connect"
252241 v-bind =" page.connect"
242+ :ui =" {
243+ features: 'block'
244+ }"
253245 >
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 >
256256
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"
264271 />
265272 </div >
266273 </UPageSection >
0 commit comments