added height and width the the ImgIcon common component in order to control the icon size so that icons that are not square dont get the bottom cut off

This commit is contained in:
csawatzky 2025-03-13 16:28:36 -06:00
parent 53a7c486ce
commit 17f4cbc242
8 changed files with 2218 additions and 17 deletions

View file

@ -8,12 +8,13 @@ import { useThemeType } from "../../hooks/useThemeType";
interface Props {
singleBin?: boolean;
type?: "light" | "dark";
size?: number;
width?: number | string;
height?: number | string;
}
export default function BinsIcon(props: Props) {
const themeType = useThemeType();
const { type, singleBin, size } = props;
const { type, singleBin, width, height } = props;
const lightIcon = () => {
return singleBin ? BinLightIcon : BinsLightIcon;
@ -31,9 +32,9 @@ export default function BinsIcon(props: Props) {
return themeType === "light" ? darkIcon() : lightIcon();
};
if (size) {
return <img width={size} height={size} alt="bins" src={src()} />;
}
// if (size) {
// return <img width={size} height={size} alt="bins" src={src()} />;
// }
return <ImgIcon alt="bins" src={src()} />;
return <ImgIcon alt="bins" src={src()} iconHeight={height} iconWidth={width}/>;
}

View file

@ -6,11 +6,13 @@ import React from "react";
interface Props {
type?: "light" | "dark";
height?: number | string
width?: number | string
}
export default function VentilationIcon(props: Props) {
const themeType = useThemeType();
const { type } = props;
const { type, height, width } = props;
const src = () => {
if (type) {
@ -20,5 +22,5 @@ export default function VentilationIcon(props: Props) {
return themeType === "light" ? MineDarkIcon : MineLightIcon;
};
return <ImgIcon alt="mine" src={src()} />;
return <ImgIcon alt="mine" src={src()} iconHeight={height} iconWidth={width}/>;
}