adding side navigator and device icon
This commit is contained in:
parent
ab4fd77471
commit
b7d859b083
1 changed files with 40 additions and 0 deletions
40
src/common/ImgIcon.tsx
Normal file
40
src/common/ImgIcon.tsx
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { Icon } from "@mui/material";
|
||||
import { makeStyles } from "@mui/styles";
|
||||
// import Image from "material-ui-image";
|
||||
import { Img as Image } from 'react-image';
|
||||
|
||||
const useStyles = makeStyles(() => ({
|
||||
icon: {
|
||||
textAlign: "center",
|
||||
margin: "1px"
|
||||
},
|
||||
img: {
|
||||
height: "100%",
|
||||
width: "auto !important"
|
||||
}
|
||||
}));
|
||||
|
||||
interface Props {
|
||||
src?: string;
|
||||
alt?: string;
|
||||
style?: any;
|
||||
}
|
||||
|
||||
export function ImgIcon(props: Props) {
|
||||
const { src, alt, style } = props;
|
||||
const classes = useStyles();
|
||||
|
||||
if (!src) return null;
|
||||
|
||||
return (
|
||||
<Icon className={classes.icon}>
|
||||
<Image
|
||||
alt={alt}
|
||||
className={classes.img}
|
||||
src={src}
|
||||
color="transparent"
|
||||
style={style}
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue