-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add token network icon * fix name
- Loading branch information
1 parent
7a55303
commit 0373b05
Showing
6 changed files
with
66 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script setup lang="ts"> | ||
import { getNetwork } from '@/networks'; | ||
import { NetworkID } from '@/types'; | ||
import { getUrl } from '@/helpers/utils'; | ||
const props = withDefaults( | ||
defineProps<{ | ||
id: string; | ||
size?: number; | ||
cb?: string; | ||
}>(), | ||
{ | ||
size: 22 | ||
} | ||
); | ||
const [network] = props.id.split(':'); | ||
const currentNetwork = computed(() => { | ||
try { | ||
return getNetwork(network as NetworkID); | ||
} catch (e) { | ||
return null; | ||
} | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div class="relative"> | ||
<img | ||
:src="(currentNetwork && getUrl(currentNetwork.avatar)) ?? undefined" | ||
:title="(currentNetwork && currentNetwork.name) ?? undefined" | ||
class="absolute rounded-full w-[16px] h-[16px] -bottom-1 -right-1 border border-skin-bg" | ||
/> | ||
<UiStamp :id="id" type="token" :size="size" /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters