mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
working typescript version
This commit is contained in:
1 parent
581d6011e0
commit
cff746aa38
119 files changed
+247
-189
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { AppIcon } from "./AppIcon";
|
||||
import { Grid, makeStyles } from "@material-ui/core";
|
||||
import { Link } from "react-router-dom";
|
||||
import { useKeyboard } from "../../os/keyboard/hooks/useKeyboard";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
marginTop: theme.spacing(3),
|
||||
},
|
||||
item: {
|
||||
marginTop: theme.spacing(3),
|
||||
width: "20%",
|
||||
},
|
||||
}));
|
||||
|
||||
export const GridMenu = ({ items, Component = AppIcon }) => {
|
||||
const setKey = useKeyboard();
|
||||
const classes = useStyles();
|
||||
|
||||
useEffect(function registerKeyHandlers() {
|
||||
setKey("ArrowLeft", () => {
|
||||
console.log(":v");
|
||||
});
|
||||
// eslint-disable-next-line
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Grid container justify="center">
|
||||
<Grid container item>
|
||||
{items &&
|
||||
items.length &&
|
||||
items.map((item) => (
|
||||
<Grid
|
||||
key={item.id}
|
||||
item
|
||||
className={classes.item}
|
||||
tabIndex="-1"
|
||||
component={Link}
|
||||
to={item.path}
|
||||
>
|
||||
<Component {...item} />
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user