From 6d7819d2776fbdec6933509722a0d7190a9f4572 Mon Sep 17 00:00:00 2001 From: J Francisco Rader Date: Sat, 22 Aug 2020 13:07:36 -0300 Subject: [PATCH] Add base settings app --- src/Phone.js | 8 ++++-- src/apps/appmarket/hooks/useApps.js | 35 +++++++----------------- src/apps/home/components/GridMenu.js | 2 +- src/apps/settings/components/Settings.js | 27 ++++++++++++++++++ 4 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 src/apps/settings/components/Settings.js diff --git a/src/Phone.js b/src/Phone.js index 1113bb0..0ea713a 100644 --- a/src/Phone.js +++ b/src/Phone.js @@ -3,13 +3,16 @@ import "./Phone.css"; import "./i18n"; import MessageIcon from "@material-ui/icons/Email"; import { Route } from "react-router-dom"; -import { HomeApp } from "./apps/home/components/Home"; -import { ContactsApp } from "./apps/contacts/components/Contacts"; import { useSettings } from "./apps/settings/hooks/useSettings"; import { NotificationBar } from "./os/components/NotificationBar"; import { NotificationIcon } from "./os/components/NotificationIcon"; import { NavigationBar } from "./os/components/NavigationBar"; + +import { HomeApp } from "./apps/home/components/Home"; +import { ContactsApp } from "./apps/contacts/components/Contacts"; +import { SettingsApp } from "./apps/settings/components/Settings"; + function Phone() { const [settings] = useSettings(); return ( @@ -33,6 +36,7 @@ function Phone() {
+
diff --git a/src/apps/appmarket/hooks/useApps.js b/src/apps/appmarket/hooks/useApps.js index 694f13c..2853b2a 100644 --- a/src/apps/appmarket/hooks/useApps.js +++ b/src/apps/appmarket/hooks/useApps.js @@ -1,8 +1,9 @@ import React, { createContext, useEffect } from "react"; import { useConfig } from "../../../config/hooks/useConfig"; -import ContactsIcon from "@material-ui/icons/Contacts"; -import { blue } from "@material-ui/core/colors"; +import { blue, grey } from "@material-ui/core/colors"; import { useTranslation } from "react-i18next"; +import ContactsIcon from "@material-ui/icons/Contacts"; +import SettingsIcon from '@material-ui/icons/Settings' const AppsContext = createContext(null); @@ -15,31 +16,15 @@ export const useApps = () => { name: t('APPS_CONTACTS'), icon: , backgroundColor: blue[500], - color: blue[50] + color: blue[50], + path: '/contacts' }, { - name: "Contacts1", - }, - { - name: "Contacts2", - }, - { - name: "Contacts3", - }, - { - name: "Contacts4", - }, - { - name: "Contacts4", - }, - { - name: "Contacts4", - }, - { - name: "Contacts4", - }, - { - name: "Contacts4", + name: t('APPS_SETTINGS'), + icon: , + backgroundColor: grey[700], + color: grey[50], + path: '/settings' } ]); // eslint-disable-next-line diff --git a/src/apps/home/components/GridMenu.js b/src/apps/home/components/GridMenu.js index 74118ae..1de7847 100644 --- a/src/apps/home/components/GridMenu.js +++ b/src/apps/home/components/GridMenu.js @@ -27,7 +27,7 @@ export const GridMenu = ({ apps }) => { key={app.name} tabindex="-1" component={Link} - to="/contacts" + to={app.path} > diff --git a/src/apps/settings/components/Settings.js b/src/apps/settings/components/Settings.js new file mode 100644 index 0000000..7edb2d5 --- /dev/null +++ b/src/apps/settings/components/Settings.js @@ -0,0 +1,27 @@ +import React from "react"; +import { AppWrapper } from "../../../ui/components"; +import { makeStyles } from "@material-ui/core"; +import { AppTitle } from "../../../ui/components/AppTitle"; +import { AppContent } from "../../../ui/components/AppContent"; +import { useTranslation } from "react-i18next"; +import { grey } from "@material-ui/core/colors"; + +const useStyles = makeStyles(() => ({ + root: { + backgroundColor: grey[50], + }, + title: { + backgroundColor: grey[600], + }, +})); + +export const SettingsApp = () => { + const classes = useStyles(); + const { t } = useTranslation(); + return ( + + {t("APPS_SETTINGS")} + {t("COMING_SOON")} + + ); +};