Make NotificationBar themable

This commit is contained in:
J Francisco Rader committed 2020-08-22 19:18:36 -03:00
1 parent 47e16573b0
commit 09634e618d
7 files changed
+34 -20

No files matched your search

+1
View File
@@ -12,6 +12,7 @@
"lodash": "^4.17.20", "lodash": "^4.17.20",
"react": "^16.13.1", "react": "^16.13.1",
"react-dom": "^16.13.1", "react-dom": "^16.13.1",
"react-hotkeys": "^2.0.0",
"react-i18next": "^11.7.1", "react-i18next": "^11.7.1",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"react-scripts": "3.4.3", "react-scripts": "3.4.3",
+3 -3
View File
@@ -5,7 +5,7 @@ import { Route } from "react-router-dom";
import { useSettings } from "./apps/settings/hooks/useSettings"; import { useSettings } from "./apps/settings/hooks/useSettings";
import { NotificationBar } from "./os/components/NotificationBar"; import { NotificationBar } from "./os/components/NotificationBar";
import { NotificationIcon } from "./os/components/NotificationIcon"; import { NotificationIcon } from "./os/components/NotificationIcon";
import { NavigationBar } from "./os/components/NavigationBar"; import { Navigation } from "./os/components/Navigation";
import MessageIcon from "@material-ui/icons/Email"; import MessageIcon from "@material-ui/icons/Email";
import { HomeApp } from "./apps/home/components/Home"; import { HomeApp } from "./apps/home/components/Home";
@@ -34,14 +34,14 @@ function Phone() {
}} }}
> >
<NotificationBar <NotificationBar
notifications={[<NotificationIcon Icon={MessageIcon} />]} notifications={[{ icon: <NotificationIcon Icon={MessageIcon} /> }, { icon: <NotificationIcon Icon={MessageIcon} /> }]}
/> />
<div className="PhoneAppContainer"> <div className="PhoneAppContainer">
<Route exact path="/" component={HomeApp} /> <Route exact path="/" component={HomeApp} />
<Route exact path="/contacts" component={ContactsApp} /> <Route exact path="/contacts" component={ContactsApp} />
<Route exact path="/settings" component={SettingsApp} /> <Route exact path="/settings" component={SettingsApp} />
</div> </div>
<NavigationBar /> <Navigation />
</div> </div>
</div> </div>
</div> </div>
+7 -4
View File
@@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import { AppWrapper } from "../../../ui/components"; import { AppWrapper } from "../../../ui/components";
import { List, ListItem, ListItemText } from "@material-ui/core"; import { List, ListItem, ListItemText, Divider } from "@material-ui/core";
import { AppTitle } from "../../../ui/components/AppTitle"; import { AppTitle } from "../../../ui/components/AppTitle";
import { AppContent } from "../../../ui/components/AppContent"; import { AppContent } from "../../../ui/components/AppContent";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@@ -14,9 +14,12 @@ import { useApps } from "../../appmarket/hooks/useApps";
export const SettingItem = ({ options, label, value, onClick }) => { export const SettingItem = ({ options, label, value, onClick }) => {
return ( return (
<ListItem onClick={() => onClick(options)} button> <>
<ListItemText primary={label} secondary={value} /> <ListItem onClick={() => onClick(options)} button>
</ListItem> <ListItemText primary={label} secondary={value} />
</ListItem>
<Divider />
</>
); );
}; };
@@ -15,7 +15,7 @@ const useStyles = makeStyles((theme) => ({
}, },
})); }));
export const NavigationBar = ({ notifications = [] }) => { export const Navigation = () => {
const classes = useStyles(); const classes = useStyles();
const history = useHistory(); const history = useHistory();
+13 -10
View File
@@ -1,16 +1,15 @@
import React from "react"; import React from "react";
import { makeStyles, Typography, Grid } from "@material-ui/core"; import { makeStyles, Typography, Grid, IconButton } from "@material-ui/core";
import { grey } from "@material-ui/core/colors";
import { fade } from "@material-ui/core/styles/colorManipulator"; import { fade } from "@material-ui/core/styles/colorManipulator";
import SignalIcon from "@material-ui/icons/SignalCellular3Bar"; import SignalIcon from "@material-ui/icons/SignalCellular3Bar";
const useStyles = makeStyles(() => ({ const useStyles = makeStyles((theme) => ({
root: { root: {
backgroundColor: fade(grey[800], 0.7), backgroundColor: fade(theme.palette.background.paper, 0.7),
height: "25px", height: "25px",
width: "100%", width: "100%",
color: "white", color: theme.palette.text.primary,
zIndex: 2 zIndex: 2,
}, },
item: { item: {
margin: "0 6px", margin: "0 6px",
@@ -18,6 +17,11 @@ const useStyles = makeStyles(() => ({
text: { text: {
position: "relative", position: "relative",
bottom: "2px", bottom: "2px",
color: theme.palette.text.primary,
},
icon: {
padding: '4px',
color: theme.palette.text.primary,
}, },
})); }));
@@ -31,9 +35,9 @@ export const NotificationBar = ({ notifications = [] }) => {
wrap="nowrap" wrap="nowrap"
> >
<Grid container item wrap="nowrap"> <Grid container item wrap="nowrap">
{notifications.map((n) => ( {notifications.map((notification) => (
<Grid item className={classes.item}> <Grid item component={IconButton} className={classes.icon}>
{n} {notification.icon}
</Grid> </Grid>
))} ))}
</Grid> </Grid>
@@ -45,7 +49,6 @@ export const NotificationBar = ({ notifications = [] }) => {
<Typography <Typography
className={classes.text} className={classes.text}
variant="button" variant="button"
color="white"
>{`AT&T`}</Typography> >{`AT&T`}</Typography>
</Grid> </Grid>
</Grid> </Grid>
+1 -1
View File
@@ -27,8 +27,8 @@ export const ContextMenu = ({ open, onClose, options }) => {
{options.map((option) => ( {options.map((option) => (
<ListItem <ListItem
selected={option.selected} selected={option.selected}
button
key={option.key || option.label} key={option.key || option.label}
button
onClick={(e) => { onClick={(e) => {
option.onClick(e, option); option.onClick(e, option);
onClose(); onClose();
+8 -1
View File
@@ -8676,7 +8676,7 @@ prompts@^2.0.1:
kleur "^3.0.3" kleur "^3.0.3"
sisteransi "^1.0.4" sisteransi "^1.0.4"
prop-types@^15.6.2, prop-types@^15.7.2: prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2" version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -8887,6 +8887,13 @@ react-error-overlay@^6.0.7:
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.7.tgz#1dcfb459ab671d53f660a991513cb2f0a0553108" resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.7.tgz#1dcfb459ab671d53f660a991513cb2f0a0553108"
integrity sha512-TAv1KJFh3RhqxNvhzxj6LeT5NWklP6rDr2a0jaTfsZ5wSZWHOGeqQyejUp3xxLfPt2UpyJEcVQB/zyPcmonNFA== integrity sha512-TAv1KJFh3RhqxNvhzxj6LeT5NWklP6rDr2a0jaTfsZ5wSZWHOGeqQyejUp3xxLfPt2UpyJEcVQB/zyPcmonNFA==
react-hotkeys@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/react-hotkeys/-/react-hotkeys-2.0.0.tgz#a7719c7340cbba888b0e9184f806a9ec0ac2c53f"
integrity sha512-3n3OU8vLX/pfcJrR3xJ1zlww6KS1kEJt0Whxc4FiGV+MJrQ1mYSYI3qS/11d2MJDFm8IhOXMTFQirfu6AVOF6Q==
dependencies:
prop-types "^15.6.1"
react-i18next@^11.7.1: react-i18next@^11.7.1:
version "11.7.1" version "11.7.1"
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.7.1.tgz#80c993bf7c4f07937ce0e5ff4e2d7d97bfe3f42f" resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.7.1.tgz#80c993bf7c4f07937ce0e5ff4e2d7d97bfe3f42f"