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

+3 -3
View File
@@ -5,7 +5,7 @@ import { Route } from "react-router-dom";
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 { Navigation } from "./os/components/Navigation";
import MessageIcon from "@material-ui/icons/Email";
import { HomeApp } from "./apps/home/components/Home";
@@ -34,14 +34,14 @@ function Phone() {
}}
>
<NotificationBar
notifications={[<NotificationIcon Icon={MessageIcon} />]}
notifications={[{ icon: <NotificationIcon Icon={MessageIcon} /> }, { icon: <NotificationIcon Icon={MessageIcon} /> }]}
/>
<div className="PhoneAppContainer">
<Route exact path="/" component={HomeApp} />
<Route exact path="/contacts" component={ContactsApp} />
<Route exact path="/settings" component={SettingsApp} />
</div>
<NavigationBar />
<Navigation />
</div>
</div>
</div>
+7 -4
View File
@@ -1,6 +1,6 @@
import React from "react";
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 { AppContent } from "../../../ui/components/AppContent";
import { useTranslation } from "react-i18next";
@@ -14,9 +14,12 @@ import { useApps } from "../../appmarket/hooks/useApps";
export const SettingItem = ({ options, label, value, onClick }) => {
return (
<ListItem onClick={() => onClick(options)} button>
<ListItemText primary={label} secondary={value} />
</ListItem>
<>
<ListItem onClick={() => onClick(options)} button>
<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 history = useHistory();
+13 -10
View File
@@ -1,16 +1,15 @@
import React from "react";
import { makeStyles, Typography, Grid } from "@material-ui/core";
import { grey } from "@material-ui/core/colors";
import { makeStyles, Typography, Grid, IconButton } from "@material-ui/core";
import { fade } from "@material-ui/core/styles/colorManipulator";
import SignalIcon from "@material-ui/icons/SignalCellular3Bar";
const useStyles = makeStyles(() => ({
const useStyles = makeStyles((theme) => ({
root: {
backgroundColor: fade(grey[800], 0.7),
backgroundColor: fade(theme.palette.background.paper, 0.7),
height: "25px",
width: "100%",
color: "white",
zIndex: 2
color: theme.palette.text.primary,
zIndex: 2,
},
item: {
margin: "0 6px",
@@ -18,6 +17,11 @@ const useStyles = makeStyles(() => ({
text: {
position: "relative",
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"
>
<Grid container item wrap="nowrap">
{notifications.map((n) => (
<Grid item className={classes.item}>
{n}
{notifications.map((notification) => (
<Grid item component={IconButton} className={classes.icon}>
{notification.icon}
</Grid>
))}
</Grid>
@@ -45,7 +49,6 @@ export const NotificationBar = ({ notifications = [] }) => {
<Typography
className={classes.text}
variant="button"
color="white"
>{`AT&T`}</Typography>
</Grid>
</Grid>
+1 -1
View File
@@ -27,8 +27,8 @@ export const ContextMenu = ({ open, onClose, options }) => {
{options.map((option) => (
<ListItem
selected={option.selected}
button
key={option.key || option.label}
button
onClick={(e) => {
option.onClick(e, option);
onClose();