Skip to content

Commit

Permalink
refactor: enable chain icons for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsos committed Nov 25, 2024
1 parent 94492a8 commit 2fd0cb1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions components/checkout/pay/CryptoChainIcon.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<script setup lang="ts">
defineProps<{
const props = defineProps<{
chain: string;
}>();
const pending = ref(true);
const error = ref(false);
const { public: { testing } } = useRuntimeConfig();
const chainName = computed<string>(() => {
if (!testing)
return props.chain;
return props.chain.replace(/sepolia/g, '').trim();
});
</script>

<template>
Expand All @@ -18,7 +27,7 @@ const error = ref(false);
<img
class="w-full h-full"
:class="{ hidden: pending || error }"
:src="`/img/chains/${chain}.svg`"
:src="`/img/chains/${chainName}.svg`"
@loadstart="pending = true"
@load="pending = false"
@error="
Expand Down

0 comments on commit 2fd0cb1

Please sign in to comment.