Update all to useUSer composabe. Still some bugs to resolve.

This commit is contained in:
Filipe Soccol
2025-04-01 12:04:24 -03:00
parent e93cac6086
commit 9fa2b34a5d
26 changed files with 495 additions and 454 deletions

View File

@@ -7,10 +7,19 @@ export const imagesPath = import.meta.glob<string>("@/assets/*.{png,svg}", {
});
export const getNetworkImage = (networkName: string): string => {
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`${networkName.toLowerCase()}.svg`)
);
return path ? imagesPath[path] : "";
try {
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`${networkName.toLowerCase()}.svg`)
);
return path ? imagesPath[path] : "";
} catch (error) {
console.error("Error fetching network image");
const path = Object.keys(imagesPath).find((key) =>
key.endsWith(`invalidIcon.svg`)
);
return path ? imagesPath[path] : "";
return "";
}
};
export const getTokenImage = (tokenName: TokenEnum): string => {