Merge pull request #29 from Re-Ignited-Development/improv/events

Improv/events
This commit is contained in:
Christopher Gjelten authored and GitHub committed 2020-11-06 12:56:25 +01:00
commit 095bc663e3
3 files changed
+40 -13

No files matched your search

+8 -2
View File
@@ -3,6 +3,7 @@ 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";
import Nui from "../../os/nui-events/utils/Nui";
interface IStyles {
root: any;
@@ -28,13 +29,18 @@ const useStyles = makeStyles(
})
);
export const AppIcon = ({ name, icon, backgroundColor, color }) => {
export const AppIcon = ({ id, name, icon, backgroundColor, color }) => {
const classes = useStyles({
backgroundColor: backgroundColor || green[50],
color: color || green[400],
});
const openAppCallback = () => {
Nui.send(`phone:app:${id}`)
}
return (
<Button className={classes.root}>
<Button onClick={openAppCallback} className={classes.root}>
<Avatar className={classes.avatar}>
{icon || name[0].toUpperCase()}
</Avatar>