mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
send app id when pressing on a app
This commit is contained in:
1 parent
c14577cd5d
commit
e21c52c289
1 file changed
+8
-2
@@ -3,6 +3,7 @@ import { makeStyles } from "@material-ui/core/styles";
|
|||||||
import Avatar from "@material-ui/core/Avatar";
|
import Avatar from "@material-ui/core/Avatar";
|
||||||
import { green } from "@material-ui/core/colors";
|
import { green } from "@material-ui/core/colors";
|
||||||
import { Button } from "@material-ui/core";
|
import { Button } from "@material-ui/core";
|
||||||
|
import Nui from "../../os/nui-events/utils/Nui";
|
||||||
|
|
||||||
interface IStyles {
|
interface IStyles {
|
||||||
root: any;
|
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({
|
const classes = useStyles({
|
||||||
backgroundColor: backgroundColor || green[50],
|
backgroundColor: backgroundColor || green[50],
|
||||||
color: color || green[400],
|
color: color || green[400],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const openAppCallback = () => {
|
||||||
|
Nui.send(`phone:app:${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button className={classes.root}>
|
<Button onClick={openAppCallback} className={classes.root}>
|
||||||
<Avatar className={classes.avatar}>
|
<Avatar className={classes.avatar}>
|
||||||
{icon || name[0].toUpperCase()}
|
{icon || name[0].toUpperCase()}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
|
|||||||
Reference in new issue
Block a user