This commit is contained in:
Georges KABBOUCHI 2022-06-09 18:59:24 +03:00
parent b0206a516b
commit 09087a50e8
3 changed files with 40 additions and 10 deletions

23
app.vue
View File

@ -2,9 +2,26 @@
<Html class="h-full bg-gray-50">
<Body class="h-full" />
</Html>
<div class="min-h-full flex flex-col items-center justify-center py-12 sm:px-6 lg:px-8">
<NuxtPage />
<div
class="min-h-full flex flex-col items-center justify-center py-12 sm:px-6 lg:px-8"
>
<NuxtLink to="/" class="mt-5 text-center text-3xl font-extrabold text-gray-900">
Smart Lookup
</NuxtLink>
<div class="mt-3">Made with by <a href="https://instadapp.io" class="hover:underline font-medium" target="_blank" rel="noopener noreferrer">Instadapp</a></div>
<div class="w-full mt-5">
<NuxtPage />
</div>
<div class="mt-5">
Made with by
<a
href="https://instadapp.io"
class="hover:underline font-medium"
target="_blank"
rel="noopener noreferrer"
>Instadapp</a
>
</div>
</div>
</template>

View File

@ -17,6 +17,15 @@ const networks = {
arbitrum: "https://rpc.ankr.com/arbitrum",
};
const networkScanBaseUrl = {
mainnet: "https://etherscan.io/",
polygon: "https://polygonscan.com/",
avalanche: "https://snowtrace.io/",
fantom: "https://ftmscan.com/",
optimism: "https://optimistic.etherscan.io/",
arbitrum: "https://arbiscan.io/",
};
const networkProviderMap = Object.keys(networks).reduce((acc, curr) => {
acc[curr] = new ethers.providers.JsonRpcProvider(networks[curr]);
return acc;
@ -241,7 +250,7 @@ onMounted(async () => {
<template>
<div class="sm:mx-auto sm:w-full sm:max-w-xl">
<div class="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<div class="flex flex-col items-center">
<div v-if="address" class="flex flex-col items-center">
<QrcodeVue
:size="196"
:value="address"
@ -260,12 +269,15 @@ onMounted(async () => {
<div class="mt-3 w-full px-20" v-if="detectedNetworks.length">
<div class="text-center flex flex-wrap justify-center gap-2">
<div
<a
v-for="network in detectedNetworks"
class="capitalize bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm shadow-sm"
:href="`${networkScanBaseUrl[network]}address/${address}`"
target="_blank"
rel="noopener noreferrer"
>
{{ network }}
</div>
</a>
</div>
</div>
@ -366,6 +378,10 @@ onMounted(async () => {
</div>
</div>
</div>
<div v-else class="flex items-center justify-center py-10">
<RefreshIcon class="w-10 h-10 animate-spin text-gray-600" />
</div>
</div>
</div>
</template>

View File

@ -12,12 +12,9 @@ const lookup = () => {
</script>
<template>
<div class="sm:mx-auto sm:w-full sm:max-w-xl">
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">
Smart Lookup
</h2>
<div
class="mt-6 bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10 flex items-center gap-4"
class="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10 flex items-center gap-4"
>
<input
v-model="address"