diff --git a/src/components/layout/LightDarkToggle.js b/src/components/layout/LightDarkToggle.js
new file mode 100644
index 0000000..cc42262
--- /dev/null
+++ b/src/components/layout/LightDarkToggle.js
@@ -0,0 +1,25 @@
+import React from "react";
+import { IconButton } from "@material-ui/core";
+import {
+ Brightness2 as MoonIcon,
+ WbSunny as SunIcon
+} from "@material-ui/icons";
+import { useApplicationTheme } from "../../providers/ThemeProvider";
+
+const LightDarkToggle = () => {
+ const { isDark, onDarkModeChanged } = useApplicationTheme();
+
+ const handleChange = () => onDarkModeChanged(!isDark);
+
+ return (
+
+ {isDark ? : }
+
+ );
+};
+
+export default LightDarkToggle;
diff --git a/src/components/layout/ProfileButton.js b/src/components/layout/ProfileButton.js
new file mode 100644
index 0000000..fbf6784
--- /dev/null
+++ b/src/components/layout/ProfileButton.js
@@ -0,0 +1,62 @@
+import React, { useState } from "react";
+import { IconButton, Menu, MenuItem } from "@material-ui/core";
+import AccountCircle from "@material-ui/icons/AccountCircle";
+import { useHistory } from "react-router-dom";
+import { useTuitioClient } from "@flare/tuitio-client-react";
+
+const ProfileButton = () => {
+ const history = useHistory();
+ const { logout } = useTuitioClient();
+
+ const [anchorEl, setAnchorEl] = useState(null);
+ const openUserMenu = Boolean(anchorEl);
+
+ const handleMenu = event => {
+ setAnchorEl(event.currentTarget);
+ };
+
+ const handleClose = () => {
+ setAnchorEl(null);
+ };
+
+ return (
+
+ );
+};
+
+export default ProfileButton;
diff --git a/src/components/layout/TopBar.js b/src/components/layout/TopBar.js
index e115da4..026f3a4 100644
--- a/src/components/layout/TopBar.js
+++ b/src/components/layout/TopBar.js
@@ -1,39 +1,17 @@
-import React, { useState } from "react";
+import React from "react";
import PropTypes from "prop-types";
import clsx from "clsx";
import { makeStyles } from "@material-ui/core/styles";
-import {
- AppBar,
- Toolbar,
- Typography,
- IconButton,
- Menu,
- MenuItem
-} from "@material-ui/core";
-
+import { AppBar, Toolbar, Typography, IconButton } from "@material-ui/core";
import MenuIcon from "@material-ui/icons/Menu";
-import AccountCircle from "@material-ui/icons/AccountCircle";
-import { useHistory } from "react-router-dom";
-import { useTuitioClient } from "@flare/tuitio-client-react";
+import ProfileButton from "./ProfileButton";
+import LightDarkToggle from "./LightDarkToggle";
import styles from "./styles";
const useStyles = makeStyles(styles);
const TopBar = ({ open, handleDrawerOpen }) => {
const classes = useStyles();
- const history = useHistory();
- const { logout } = useTuitioClient();
-
- const [userAnchorEl, setUserAnchorEl] = useState(null);
- const openUserMenu = Boolean(userAnchorEl);
-
- const handleMenu = event => {
- setUserAnchorEl(event.currentTarget);
- };
-
- const handleClose = () => {
- setUserAnchorEl(null);
- };
return (
{
Network resurrector
-
+
+
);