Compare commits
7 Commits
a5f02a99b1
...
refactor/n
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e5516972a | ||
|
|
a3e3f0506c | ||
|
|
976c48ac4b | ||
|
|
7bcf5d90c2 | ||
|
|
358ae7410f | ||
|
|
a906fa136d | ||
|
|
7ec73e8c6f |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
76
src/assets/networks/rootstock-testnet.svg
Normal file
|
After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 644 B After Width: | Height: | Size: 644 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
@@ -1,29 +1,11 @@
|
||||
import type { TokenEnum } from "@/model/NetworkEnum";
|
||||
|
||||
export const imagesPath = import.meta.glob<string>("@/assets/*.{png,svg}", {
|
||||
eager: true,
|
||||
query: "?url",
|
||||
import: "default",
|
||||
});
|
||||
import { Networks } from "@/config/networks";
|
||||
|
||||
export const getNetworkImage = (networkName: string): string => {
|
||||
const imageName = networkName
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]/g, '-');
|
||||
try {
|
||||
const path = Object.keys(imagesPath).find((key) =>
|
||||
key.endsWith(`${imageName}.svg`)
|
||||
);
|
||||
return path ? imagesPath[path] : "";
|
||||
} catch (error) {
|
||||
console.error("Error fetching network image");
|
||||
return "";
|
||||
}
|
||||
const normalizedName = networkName.toLowerCase().replace(/[^a-z0-9]/g, '-');
|
||||
return new URL(`../assets/networks/${normalizedName}.svg`, import.meta.url).href;
|
||||
};
|
||||
|
||||
export const getTokenImage = (tokenName: TokenEnum): string => {
|
||||
const path = Object.keys(imagesPath).find((key) =>
|
||||
key.endsWith(`${tokenName.toLowerCase()}.svg`)
|
||||
);
|
||||
return path ? imagesPath[path] : "";
|
||||
return new URL(`../assets/tokens/${tokenName.toLowerCase()}.svg`, import.meta.url).href;
|
||||
};
|
||||
|
||||
@@ -69,7 +69,7 @@ const sendNetwork = async () => {
|
||||
/>
|
||||
<div v-if="flowStep == Step.Network">
|
||||
<SendNetwork
|
||||
:sellerId="user.sellerId.value"
|
||||
:sellerId="Number(user.sellerId.value)"
|
||||
:offer="Number(user.seller.value.offer)"
|
||||
:selected-token="user.selectedToken.value"
|
||||
v-if="!loading"
|
||||
|
||||