diff --git a/public/banner.jpg b/public/banner.jpg new file mode 100644 index 0000000..8d8764c Binary files /dev/null and b/public/banner.jpg differ diff --git a/src/App.js b/src/App.js index c8fcb8f..e3ea623 100644 --- a/src/App.js +++ b/src/App.js @@ -3,39 +3,13 @@ import { makeStyles } from '@mui/styles'; import { initializeApp } from 'firebase/app'; import { onAuthStateChanged, getAuth } from 'firebase/auth'; import { getDatabase, ref, get } from 'firebase/database'; -import CircularProgress from '@mui/material/CircularProgress'; import AppContext from './app-context'; -import AuthenticatedRoot from './app/pathing/authed-root'; import AppBar from './app/app-bar'; -import SignInBox from './app/sign-in'; -import WaitWindow from './app/wait-window'; +import AppAuthed from './app-authed'; +import AppUnauthed from './app-unauthed'; +import appTheme from './app-theme'; -const drawerWidth = 320; - -const useStyles = makeStyles((theme) => ({ - rootContainer: { - display: 'flex', - flexGrow: 1, - marginTop: 80 - }, - appBar: { - zIndex: theme.zIndex.drawer + 1, - }, - menuButton: { - marginRight: theme.spacing(2), - }, - drawer: { - width: drawerWidth, - flexShrink: 0, - }, - drawerPaper: { - width: drawerWidth, - }, - content: { - flexGrow: 1, - padding: theme.spacing(3), - }, -})); +const useStyles = makeStyles(appTheme); let firebaseApp; @@ -84,17 +58,10 @@ const App = () => { return (
- - { firebaseApp && getAuth().currentUser && ( - - - -
- -
-
- )} - { (!firebaseApp || !getAuth().currentUser) && () } + + + { firebaseApp && getAuth().currentUser && ()} + { (!firebaseApp || !getAuth().currentUser) && () }
); }; diff --git a/src/app-authed.js b/src/app-authed.js new file mode 100644 index 0000000..f489413 --- /dev/null +++ b/src/app-authed.js @@ -0,0 +1,18 @@ +import React from 'react'; +import { makeStyles } from '@mui/styles'; +import AuthenticatedRoot from './app/pathing/authed-root'; +import appTheme from './app-theme'; + +const useStyles = makeStyles(appTheme); + +const AppAuthed = () => { + const classes = useStyles(); + + return ( +
+ +
+
); +}; + +export default AppAuthed; diff --git a/src/app-theme.js b/src/app-theme.js new file mode 100644 index 0000000..9bccf89 --- /dev/null +++ b/src/app-theme.js @@ -0,0 +1,28 @@ +const drawerWidth = 320; + +const AppTheme = (theme) => ({ + rootContainer: { + display: 'flex', + flexGrow: 1, + flexWrap: 'wrap' + }, + appBar: { + zIndex: theme.zIndex.drawer + 1, + }, + menuButton: { + marginRight: theme.spacing(2), + }, + drawer: { + width: drawerWidth, + flexShrink: 0, + }, + drawerPaper: { + width: drawerWidth, + }, + content: { + flexGrow: 1, + padding: theme.spacing(3), + }, +}); + +export default AppTheme; diff --git a/src/app-unauthed.js b/src/app-unauthed.js new file mode 100644 index 0000000..06f3365 --- /dev/null +++ b/src/app-unauthed.js @@ -0,0 +1,44 @@ +import React from 'react'; + +import SignInBox from './app/sign-in'; +import { Typography } from '@mui/material'; + +const AppUnauthed = () => { + return ( +
+
+
+ +
+
+ + Reliable Handyman Services in Cincinnati + + + Big or small, we fix it all! + + + (513) 520-2047 + +
+
+
+
+
+ {/*
+ +
*/} +
+ + +
+ ) +} + +export default AppUnauthed; diff --git a/src/app/app-bar.js b/src/app/app-bar.js index 031b055..dbd0f9d 100644 --- a/src/app/app-bar.js +++ b/src/app/app-bar.js @@ -34,7 +34,7 @@ const useStyles = makeStyles((theme) => ({ }, })); -const TopAppBar = () => { +const TopAppBar = ({ authorized = false }) => { const classes = useStyles(); const [menuOpen, setMenuOpen] = useState(false); const iconRef = useRef(null); @@ -53,50 +53,50 @@ const TopAppBar = () => { setMenuOpen(false) }; - const { displayName, photoURL } = getAuth().currentUser; - if (!getAuth().currentUser) return null; - - return ( + return (
- + - { - accessLevel >= 4 && ( -
- { - Object.keys(CrudDefs).map((key) => ( - - {CrudDefs[key].crudLabel} - - )) - } -
- ) - } - - -
- Logged in as -
- {displayName} -
-
- + { + accessLevel >= 4 && ( +
+ { + Object.keys(CrudDefs).map((key) => ( + + {CrudDefs[key].crudLabel} + + )) + } +
+ ) + } + + - Logout - - +
+ Logged in as +
+ {getAuth().currentUser.displayName} +
+
+ + Logout + +
+ ) }
); diff --git a/src/app/sign-in.js b/src/app/sign-in.js index 383f4f3..4da1492 100644 --- a/src/app/sign-in.js +++ b/src/app/sign-in.js @@ -9,8 +9,7 @@ const SignIn = () => { await signInWithPopup(getAuth(), new GoogleAuthProvider()); } - return (
- + return ( -
); + ); }; export default SignIn;