Total overhaul

This commit is contained in:
Filipe Soccol
2024-11-07 11:35:15 -03:00
parent 9205909f9f
commit 659db5ef04
35 changed files with 1404 additions and 646 deletions

View File

@@ -1,17 +1,21 @@
import type { NetworkEnum, TokenEnum } from "@/model/NetworkEnum";
import type { TokenEnum } from "@/model/NetworkEnum";
export const imagesPath = import.meta.glob<string>('@/assets/*.{png,svg}', { eager: true, query: '?url', import: 'default' });
export const imagesPath = import.meta.glob<string>("@/assets/*.{png,svg}", {
eager: true,
query: "?url",
import: "default",
});
export const getNetworkImage = (networkName: string): string => {
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`${networkName.toLowerCase()}.svg`)
);
return path ? imagesPath[path] : "";
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`${networkName.toLowerCase()}.svg`)
);
return path ? imagesPath[path] : "";
};
export const getTokenImage = (tokenName: TokenEnum): string => {
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`${tokenName.toLowerCase()}.svg`)
);
return path ? imagesPath[path] : "";
};
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`${tokenName.toLowerCase()}.svg`)
);
return path ? imagesPath[path] : "";
};