Contacts app!

This commit is contained in:
J Francisco Rader committed 2020-08-22 02:23:17 -03:00
1 parent 3900b9fa83
commit 23e69d1193
10 files changed
+271 -11

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import React from "react";
import { AppWrapper } from "../../../ui/components";
import { useSettings } from "../../settings/hooks/useSettings";
import { Box } from "@material-ui/core";
export const ContactsApp = () => {
const [settings] = useSettings();
return (
<AppWrapper>
<Box padding={2}>
Contacts !!!
</Box>
</AppWrapper>
);
};
+19 -1
View File
@@ -1,7 +1,25 @@
import React from "react";
import { makeStyles } from "@material-ui/core/styles";
import Avatar from "@material-ui/core/Avatar";
import { useSettings } from "../../settings/hooks/useSettings";
import { Button } from "@material-ui/core";
const useStyles = makeStyles((theme) => ({
root: {
display: 'flex',
'& > *': {
margin: theme.spacing(1),
},
},
avatar: {
width: theme.spacing(8),
height: theme.spacing(8),
fontSize: theme.typography.h4.fontSize
},
}));
export const AppIcon = ({ label, icon }) => {
const [settings] = useSettings();
return <span>{label}</span>;
const classes = useStyles();
return <Button className={classes.root}><Avatar className={classes.avatar}>{label[0].toUpperCase()}</Avatar></Button>;
};
+7 -5
View File
@@ -1,14 +1,16 @@
import React from "react";
import { AppIcon } from "./AppIcon";
import { Grid } from "@material-ui/core";
import { Link } from "react-router-dom";
export const GridMenu = ({ apps }) => {
return (
<div style={{ display: "flex" }}>
<Grid container spacing={6}>
{apps.map((app) => (
<div style={{ flex: '1 1 20%', }}>
<AppIcon icon={app.icon} label={app.name} />
</div>
<Grid item component={Link} to="/contacts">
<AppIcon icon={app.icon} label={app.name} />
</Grid>
))}
</div>
</Grid>
);
};
+4 -1
View File
@@ -2,6 +2,7 @@ import React from "react";
import { AppWrapper } from "../../../ui/components";
import { useSettings } from "../../settings/hooks/useSettings";
import { GridMenu } from "./GridMenu";
import { Box } from "@material-ui/core";
export const HomeApp = () => {
const [settings] = useSettings();
@@ -11,7 +12,9 @@ export const HomeApp = () => {
backgroundImage: `${process.env.PUBLIC_URL}url(/media/backgrounds/${settings.wallpaper})`,
}}
>
<GridMenu apps={settings.apps} />
<Box padding={2}>
<GridMenu apps={settings.apps} />
</Box>
</AppWrapper>
);
};
+16
View File
@@ -1,6 +1,22 @@
{
"wallpaper": "default.png",
"apps": [
{
"name": "Contacts",
"icon": "contacts.png"
},
{
"name": "Contacts",
"icon": "contacts.png"
},
{
"name": "Contacts",
"icon": "contacts.png"
},
{
"name": "Contacts",
"icon": "contacts.png"
},
{
"name": "Contacts",
"icon": "contacts.png"