Move GridMenu to ui/

This commit is contained in:
J Francisco Rader committed 2020-08-22 16:02:25 -03:00
1 parent 34bfab2448
commit 0bbd463c01
2 files changed
+10 -10

No files matched your search

+2 -2
View File
@@ -1,14 +1,14 @@
import React from "react";
import { AppWrapper } from "../../../ui/components";
import { GridMenu } from "./GridMenu";
import { Box } from "@material-ui/core";
import { useApps } from "../../appmarket/hooks/useApps";
import { GridMenu } from "../../../ui/components/GridMenu";
export const HomeApp = () => {
const { apps } = useApps();
return (
<AppWrapper>
<Box width="100%" mt={6} px={1}>{apps && <GridMenu apps={apps.preinstalled} />}</Box>
<Box width="100%" mt={6} px={1}>{apps && <GridMenu items={apps.preinstalled} />}</Box>
</AppWrapper>
);
};
@@ -1,5 +1,5 @@
import React from "react";
import { AppIcon } from "../../../ui/components/AppIcon";
import { AppIcon } from "./AppIcon";
import { Grid, makeStyles } from "@material-ui/core";
import { Link } from "react-router-dom";
@@ -13,23 +13,23 @@ const useStyles = makeStyles(theme => ({
}
}));
export const GridMenu = ({ apps }) => {
export const GridMenu = ({ items, Component = AppIcon }) => {
const classes = useStyles();
return (
<Grid container justify="center">
<Grid container item>
{apps &&
apps.length &&
apps.map((app) => (
{items &&
items.length &&
items.map((item) => (
<Grid
item
className={classes.item}
key={app.name}
key={item.name}
tabindex="-1"
component={Link}
to={app.path}
to={item.path}
>
<AppIcon {...app} />
<Component {...item} />
</Grid>
))}
</Grid>