Skip to content

Commit

Permalink
Merge branch 'capstone_dev' of https://github.com/NCAR/chemistrycafe
Browse files Browse the repository at this point in the history
…into capstone_dev
  • Loading branch information
AmazingBrandonL committed Apr 9, 2024
2 parents 6adc67a + 59d8c3b commit 72fec9f
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/webPages/logIn.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@
.L5 { grid-area: L5; }
.M5 { grid-area: M5; }
.R5 { grid-area: R5; }
.L7 { grid-area: L7; }
.M7 { grid-area: M7; }
.R7 { grid-area: R7; }


38 changes: 38 additions & 0 deletions src/webPages/logIn.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as React from 'react';
import { useNavigate } from 'react-router-dom';
import { useState, useEffect } from 'react';
import { googleLogout, useGoogleLogin } from '@react-oauth/google';
import axios from 'axios';
import "./logIn.css";
import Button from "@mui/material/Button";
import Box from '@mui/material/Box';
import Modal from '@mui/material/Modal';
import Typography from '@mui/material/Typography';

interface User {
Expand All @@ -27,6 +29,14 @@ interface Profile {
const navigate = useNavigate();
const handleClick = () => navigate('/LoggedIn');

const [aboutOpen, setAboutOpen] = React.useState(false);
const handleAboutOpen = () => setAboutOpen(true);
const handleAboutClose = () => setAboutOpen(false);

const handleAbout = () => {
handleAboutOpen();
};

const login = useGoogleLogin({
onSuccess: (codeResponse) => setUser(codeResponse),
onError: (error) => console.log('Login Failed:', error)
Expand Down Expand Up @@ -55,6 +65,18 @@ interface Profile {
setProfile(null);
};

const style = {
position: 'absolute' as 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 400,
bgcolor: 'background.paper',
border: '2px solid #000',
boxShadow: 24,
p: 4,
};

return (
<section className="layout">
<div className="L1">
Expand Down Expand Up @@ -97,6 +119,22 @@ interface Profile {
</Button>
</div>

<div className='M7'>
<Button onClick={handleAbout}>
About
</Button>
</div>

<div>
<Modal
open={aboutOpen}
onClose={handleAboutClose}
>
<Box sx={style}>
About
</Box>
</Modal>
</div>
</section>
);

Expand Down
63 changes: 63 additions & 0 deletions src/webPages/loggedIn.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,73 @@
import * as React from 'react';
import { useNavigate } from 'react-router-dom';
import Box from '@mui/material/Box';
import Button from "@mui/material/Button";
import ButtonGroup from '@mui/material/ButtonGroup';
import Divider from '@mui/material/Divider';

Check failure on line 6 in src/webPages/loggedIn.tsx

View workflow job for this annotation

GitHub Actions / build (16.x)

'Divider' is declared but its value is never read.

Check failure on line 6 in src/webPages/loggedIn.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'Divider' is declared but its value is never read.
import Drawer from '@mui/material/Drawer';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemText from '@mui/material/ListItemText';

import DensitySmallSharpIcon from '@mui/icons-material/DensitySmallSharp';


const LoggedIn = () => {
const navigate = useNavigate();
const handleClickFam = () => navigate('/FamilyPage');
const handleClickMech = () => navigate('/Mechanisms');
const handleClickSettings = () => navigate('/Settings');

const [openDrawer, setOpenDrawer] = React.useState(false);
const toggleDrawer = (newOpenDrawer: boolean) => () => {
setOpenDrawer(newOpenDrawer);
};
const goHome = () => navigate('/LoggedIn');
const goFamily = () => navigate('/FamilyPage');
const goMech = () => navigate('/Mechanisms');
const goLogOut = () => navigate('/');

const DrawerList = (
<Box sx={{width: 250}} role="presentation" onClick={toggleDrawer(false)}>
<List>
<ListItem disablePadding>
<ListItemButton onClick={goHome}>
<ListItemText primary={"Home"} />
</ListItemButton>
</ListItem>
<ListItem disablePadding>
<ListItemButton onClick={goFamily}>
<ListItemText primary={"Families"} />
</ListItemButton>
</ListItem>
<ListItem disablePadding>
<ListItemButton onClick={goMech}>
<ListItemText primary={"Mechanisms"} />
</ListItemButton>
</ListItem>
<ListItem disablePadding>
<ListItemButton onClick={goLogOut}>
<ListItemText primary={"Log Out"} />
</ListItemButton>
</ListItem>
</List>
</Box>
);

const style = {
height: '75px',
width: '500px',
};
return (
<section className='layout'>

<div className='L1'>
<Button onClick={toggleDrawer(true)}>
<DensitySmallSharpIcon sx={{fontSize: 50}}></DensitySmallSharpIcon>
</Button>
</div>

<div className="M4">
<ButtonGroup orientation='vertical' variant='contained'>
<Button sx={style} onClick={handleClickFam}>
Expand All @@ -29,7 +83,16 @@ import ButtonGroup from '@mui/material/ButtonGroup';
</Button>
</ButtonGroup>
</div>

<div>
<Drawer
open={openDrawer} onClose={toggleDrawer(false)}
>
{DrawerList}
</Drawer>
</div>
</section>

);

}
Expand Down

0 comments on commit 72fec9f

Please sign in to comment.