remove warnings

This commit is contained in:
Michael Fatemi 2021-04-10 20:28:51 -04:00
parent e475219769
commit ef0e4ce745
4 changed files with 25 additions and 69 deletions

View File

@ -37,7 +37,7 @@ export default function Authenticator() {
.catch(() => {
setStatus('errored');
});
}, [code, provider]);
}, [code, provider, refreshAuthState]);
switch (status) {
case 'authenticated':

View File

@ -43,23 +43,30 @@ export default function Group() {
makeAPIGetCall('/group', { id }).then((res) => setGroup(res.data.data));
}, [id]);
if (!group) {
return <h1 style={{ textAlign: 'center' }}>Loading</h1>;
}
return (
<div style={{ width: '100%', display: 'flex', flexDirection: 'column' }}>
<Typography variant="h1">Group</Typography>
<h1
className="d-flex justify-content-center p-4"
style={{ backgroundColor: '#F1EAE8', fontFamily: 'Impact' }}
<div
style={{
width: '100%',
display: 'flex',
flexDirection: 'column',
padding: '1rem',
}}
>
<Typography variant="h1" align="center">
Group {group.id}
</Typography>
<Typography variant="h3" align="center">
Pools
</h1>
<a
className="btn btn-large btn-success"
href="/create_pool"
style={{ fontFamily: 'Courier New' }}
>
</Typography>
<a className="btn btn-large btn-success" href="/create_pool">
Create Pool
</a>
<div className="container" style={{ fontFamily: 'Courier New' }}>
<div className="container">
<br></br>
{pools.map((pool, index) => {
let background;

View File

@ -86,7 +86,7 @@ export default function Pool() {
}
});
}
}, [user]);
}, [user, id, pool]);
useEffect(() => {
fetch(`${process.env.REACT_APP_API_ENDPOINT}/pool/${id}`)

View File

@ -19,60 +19,9 @@ const useStyles = makeStyles({
});
const Profile = () => {
const { user, isLoggedIn } = useContext(AuthenticationContext);
const [groups, setGroups] = useState<Carpool.Group[]>([]);
const [pools, setPools] = useState<Carpool.Pool[]>([
/*
{
id: 1,
pool_title: 'TJ Carpool',
pool_text: 'Carpool from TJ track to homes',
start_time: '4/10/2021 3:00 PM',
end_time: '4/10/2021 4:00 PM',
capacity: 2,
participants: [],
comments: [
'What is the covid vaccination status of all the participants?',
],
},
{
id: 2,
pool_title: 'TJ Carpool',
pool_text: 'Carpool from TJ track to homes',
start_time: '4/10/2021 3:00 PM',
end_time: '4/10/2021 4:00 PM',
capacity: 2,
participants: [],
comments: [
'What is the covid vaccination status of all the participants?',
],
},
{
id: 3,
pool_title: 'TJ Carpool',
pool_text: 'Carpool from TJ track to homes',
start_time: '4/10/2021 3:00 PM',
end_time: '4/10/2021 4:00 PM',
capacity: 2,
participants: [],
comments: [
'What is the covid vaccination status of all the participants?',
],
},
{
id: 4,
pool_title: 'TJ Carpool',
pool_text: 'Carpool from TJ track to homes',
start_time: '4/10/2021 3:00 PM',
end_time: '4/10/2021 4:00 PM',
capacity: 2,
participants: [],
comments: [
'What is the covid vaccination status of all the participants?',
],
},
*/
]);
const { user } = useContext(AuthenticationContext);
// const [groups, setGroups] = useState<Carpool.Group[]>([]);
const [pools, setPools] = useState<Carpool.Pool[]>([]);
const classes = useStyles();
useEffect(() => {