mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Wohoo
This commit is contained in:
1 parent
23e69d1193
commit
2b94b56c92
11 files changed
+99
-41
No files matched your search
@@ -4,6 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@material-ui/core": "^4.11.0",
|
"@material-ui/core": "^4.11.0",
|
||||||
|
"@material-ui/icons": "^4.9.1",
|
||||||
"@testing-library/jest-dom": "^4.2.4",
|
"@testing-library/jest-dom": "^4.2.4",
|
||||||
"@testing-library/react": "^9.5.0",
|
"@testing-library/react": "^9.5.0",
|
||||||
"@testing-library/user-event": "^7.2.1",
|
"@testing-library/user-event": "^7.2.1",
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import React, { createContext, useEffect } from "react";
|
||||||
|
import { useConfig } from "../../../config/hooks/useConfig";
|
||||||
|
import ContactsIcon from "@material-ui/icons/Contacts";
|
||||||
|
|
||||||
|
const AppsContext = createContext(null);
|
||||||
|
|
||||||
|
export const useApps = () => {
|
||||||
|
const [apps, setApps] = useConfig(AppsContext);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setApps("preinstalled", [
|
||||||
|
{
|
||||||
|
name: "Contacts",
|
||||||
|
icon: <ContactsIcon />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Contacts1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Contacts2",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Contacts3",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Contacts4",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
// eslint-disable-next-line
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return [apps, setApps];
|
||||||
|
};
|
||||||
@@ -1,15 +1,27 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { AppWrapper } from "../../../ui/components";
|
import { AppWrapper } from "../../../ui/components";
|
||||||
import { useSettings } from "../../settings/hooks/useSettings";
|
import { makeStyles } from "@material-ui/core";
|
||||||
import { Box } from "@material-ui/core";
|
import lightBlue from "@material-ui/core/colors/lightBlue";
|
||||||
|
import { AppTitle } from "../../../ui/components/AppTitle";
|
||||||
|
import { AppContent } from "../../../ui/components/AppContent";
|
||||||
|
|
||||||
|
const useStyles = makeStyles(() => ({
|
||||||
|
root: {
|
||||||
|
backgroundColor: lightBlue[50],
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
backgroundColor: lightBlue[300],
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
export const ContactsApp = () => {
|
export const ContactsApp = () => {
|
||||||
const [settings] = useSettings();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<AppWrapper>
|
<AppWrapper className={classes.root}>
|
||||||
<Box padding={2}>
|
<AppTitle className={classes.title}>Contacts</AppTitle>
|
||||||
Contacts !!!
|
<AppContent>
|
||||||
</Box>
|
Coming soon...
|
||||||
|
</AppContent>
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from "@material-ui/core/styles";
|
||||||
import Avatar from "@material-ui/core/Avatar";
|
import Avatar from "@material-ui/core/Avatar";
|
||||||
import { useSettings } from "../../settings/hooks/useSettings";
|
|
||||||
import { Button } from "@material-ui/core";
|
import { Button } from "@material-ui/core";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
@@ -19,7 +18,6 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const AppIcon = ({ label, icon }) => {
|
export const AppIcon = ({ label, icon }) => {
|
||||||
const [settings] = useSettings();
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return <Button className={classes.root}><Avatar className={classes.avatar}>{label[0].toUpperCase()}</Avatar></Button>;
|
return <Button className={classes.root}><Avatar className={classes.avatar}>{icon || label[0].toUpperCase()}</Avatar></Button>;
|
||||||
};
|
};
|
||||||
@@ -5,9 +5,9 @@ import { Link } from "react-router-dom";
|
|||||||
|
|
||||||
export const GridMenu = ({ apps }) => {
|
export const GridMenu = ({ apps }) => {
|
||||||
return (
|
return (
|
||||||
<Grid container spacing={6}>
|
<Grid container spacing={1}>
|
||||||
{apps.map((app) => (
|
{apps && apps.length && apps.map((app) => (
|
||||||
<Grid item component={Link} to="/contacts">
|
<Grid item key={app.name} component={Link} to="/contacts">
|
||||||
<AppIcon icon={app.icon} label={app.name} />
|
<AppIcon icon={app.icon} label={app.name} />
|
||||||
</Grid>
|
</Grid>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -3,18 +3,19 @@ import { AppWrapper } from "../../../ui/components";
|
|||||||
import { useSettings } from "../../settings/hooks/useSettings";
|
import { useSettings } from "../../settings/hooks/useSettings";
|
||||||
import { GridMenu } from "./GridMenu";
|
import { GridMenu } from "./GridMenu";
|
||||||
import { Box } from "@material-ui/core";
|
import { Box } from "@material-ui/core";
|
||||||
|
import { useApps } from "../../appmarket/hooks/useApps";
|
||||||
|
|
||||||
export const HomeApp = () => {
|
export const HomeApp = () => {
|
||||||
const [settings] = useSettings();
|
const [settings] = useSettings();
|
||||||
|
const [apps] = useApps();
|
||||||
|
console.log(apps)
|
||||||
return (
|
return (
|
||||||
<AppWrapper
|
<AppWrapper
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `${process.env.PUBLIC_URL}url(/media/backgrounds/${settings.wallpaper})`,
|
backgroundImage: `${process.env.PUBLIC_URL}url(/media/backgrounds/${settings.wallpaper})`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box padding={2}>
|
<Box padding={2}>{apps && <GridMenu apps={apps.preinstalled} />}</Box>
|
||||||
<GridMenu apps={settings.apps} />
|
|
||||||
</Box>
|
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -1,25 +1,3 @@
|
|||||||
{
|
{
|
||||||
"wallpaper": "default.png",
|
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { Box } from "@material-ui/core";
|
||||||
|
|
||||||
|
export const AppContent = ({ children, style, ...props }) => {
|
||||||
|
return (
|
||||||
|
<Box px={2} pt={1} style={{ width: '100%', ...props }} {...props}>
|
||||||
|
{children}
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { Typography, Box } from "@material-ui/core";
|
||||||
|
|
||||||
|
export const AppTitle = ({ children, style, ...props }) => {
|
||||||
|
return (
|
||||||
|
<Box px={2} pt={4} style={{ width: '100%', ...props }} {...props}>
|
||||||
|
<Typography paragraph variant="h4">{children}</Typography>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -4,9 +4,17 @@ export const AppWrapper = ({ children, style, ...props }) => {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
{...props}
|
{...props}
|
||||||
style={{ width: "100%", height: "100%", display: "flex", ...style }}
|
style={{
|
||||||
|
padding: 0,
|
||||||
|
margin: 0,
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
...style,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ padding: "1em" }}>{children}</div>
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -1379,6 +1379,13 @@
|
|||||||
react-is "^16.8.0"
|
react-is "^16.8.0"
|
||||||
react-transition-group "^4.4.0"
|
react-transition-group "^4.4.0"
|
||||||
|
|
||||||
|
"@material-ui/icons@^4.9.1":
|
||||||
|
version "4.9.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.9.1.tgz#fdeadf8cb3d89208945b33dbc50c7c616d0bd665"
|
||||||
|
integrity sha512-GBitL3oBWO0hzBhvA9KxqcowRUsA0qzwKkURyC8nppnC3fw54KPKZ+d4V1Eeg/UnDRSzDaI9nGCdel/eh9AQMg==
|
||||||
|
dependencies:
|
||||||
|
"@babel/runtime" "^7.4.4"
|
||||||
|
|
||||||
"@material-ui/styles@^4.10.0":
|
"@material-ui/styles@^4.10.0":
|
||||||
version "4.10.0"
|
version "4.10.0"
|
||||||
resolved "https://registry.yarnpkg.com/@material-ui/styles/-/styles-4.10.0.tgz#2406dc23aa358217aa8cc772e6237bd7f0544071"
|
resolved "https://registry.yarnpkg.com/@material-ui/styles/-/styles-4.10.0.tgz#2406dc23aa358217aa8cc772e6237bd7f0544071"
|
||||||
|
|||||||
Reference in new issue
Block a user