Skip to content

Commit

Permalink
Reset files
Browse files Browse the repository at this point in the history
  • Loading branch information
mattupham committed Aug 9, 2024
1 parent 67b3ae3 commit 6462385
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions packages/web/components/assets/chain-logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,14 @@ import classNames from "classnames";
import { rgba } from "polished";
import { FunctionComponent } from "react";

import { FallbackImg } from "~/components/assets/fallback-img";
interface ChainLogoProps {
color: string | undefined;
logoUri: string | undefined;
prettyName?: string;
size?: "xs" | "sm" | "md" | "lg";
size?: "xs" | "sm" | "lg";
className?: string;
}

const getImageClasses = (size: ChainLogoProps["size"]) => {
switch (size) {
case "xs":
return "h-3 w-3";
case "sm":
return "h-4 w-4";
case "md":
return "h-5 w-5";
default:
return "h-6 w-6";
}
};

export const ChainLogo: FunctionComponent<ChainLogoProps> = ({
color,
logoUri,
Expand All @@ -39,7 +25,6 @@ export const ChainLogo: FunctionComponent<ChainLogoProps> = ({
{
xs: "h-4 w-4 rounded-sm",
sm: "h-6 w-6 rounded-md",
md: "h-8 w-8 rounded-lg",
lg: "h-12 w-12 rounded-xl",
}[size],
className
Expand All @@ -49,11 +34,13 @@ export const ChainLogo: FunctionComponent<ChainLogoProps> = ({
}}
>
{logoUri && (
<FallbackImg
className={classNames("object-contain", getImageClasses(size))}
<img
className={classNames(
"object-contain",
size === "xs" ? "h-3 w-3" : size === "sm" ? "h-4 w-4" : "h-8 w-8"
)}
src={logoUri}
alt={`${prettyName} logo`}
fallbacksrc="/icons/question-mark.svg"
/>
)}
</div>
Expand Down

0 comments on commit 6462385

Please sign in to comment.