working typescript version

This commit is contained in:
erik-sn committed 2020-10-07 12:19:55 -04:00
1 parent 581d6011e0
commit cff746aa38
119 files changed
+247 -189

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
import React from "react";
import { makeStyles } from "@material-ui/core/styles";
import Avatar from "@material-ui/core/Avatar";
import { green } from "@material-ui/core/colors";
import { Button } from "@material-ui/core";
const useStyles = makeStyles((theme) => ({
root: {
display: "flex",
"& > *": {
margin: theme.spacing(1),
},
padding: 0,
},
avatar: {
backgroundColor: ({ backgroundColor }) => backgroundColor,
color: ({ color }) => color,
width: theme.spacing(7),
height: theme.spacing(7),
fontSize: theme.typography.h4.fontSize,
},
}));
export const AppIcon = ({ name, icon, backgroundColor, color }) => {
const classes = useStyles({
backgroundColor: backgroundColor || green[50],
color: color || green[400],
});
return (
<Button className={classes.root}>
<Avatar className={classes.avatar}>
{icon || name[0].toUpperCase()}
</Avatar>
</Button>
);
};