Skip to content

Commit

Permalink
chore: show button for crypto map if the iframe cannot be loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax committed Oct 10, 2024
1 parent 7361d4d commit 74c21bf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/slices/CryptoMapContinentSelector/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ watch([activeItemIndex, iframe], () => {
}, { immediate: true })
const allowMapInteraction = ref(false)
const couldLoadMap = ref(true)
useEventListener(iframe, 'error', () => {
couldLoadMap.value = false
})
</script>

<template>
<section flex="col lg:row gap-x-24 gap-y-64 lg:gap-y-32" px="0 lg:64 xl:0" max-w="$nq-max-width" nq-wide bg-neutral-100>
<section v-if="couldLoadMap" flex="col lg:row gap-x-24 gap-y-64 lg:gap-y-32" px="0 lg:64 xl:0" max-w="$nq-max-width" nq-wide bg-neutral-100>
<div max-lg:w-full>
<ul flex="~ lg:col gap-16" max-lg="snap-x snap-mandatory scroll-pl-32 md:scroll-pl-64 of-x-auto nq-scrollbar-hide py-20 lg:py-40">
<li
Expand Down Expand Up @@ -125,4 +130,9 @@ const allowMapInteraction = ref(false)
/>
</div>
</section>
<section v-else bg-neutral-100 pt-0>
<NuxtLink to="https://map.nimiq.com" target="_blank" mx-auto w-max nq-arrow nq-pill-lg nq-pill-blue>
Explore the Crypto Map
</NuxtLink>
</section>
</template>

0 comments on commit 74c21bf

Please sign in to comment.