mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
Improve AppIcon
This commit is contained in:
1 parent
2b94b56c92
commit
205dcabf12
5 files changed
+40
-28
No files matched your search
@@ -0,0 +1,32 @@
|
||||
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),
|
||||
},
|
||||
},
|
||||
avatar: {
|
||||
backgroundColor: ({ backgroundColor }) => backgroundColor,
|
||||
color: ({ color }) => color,
|
||||
width: theme.spacing(8),
|
||||
height: theme.spacing(8),
|
||||
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>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user