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(() => { .catch(() => {
setStatus('errored'); setStatus('errored');
}); });
}, [code, provider]); }, [code, provider, refreshAuthState]);
switch (status) { switch (status) {
case 'authenticated': case 'authenticated':

View File

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

View File

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

View File

@ -19,60 +19,9 @@ const useStyles = makeStyles({
}); });
const Profile = () => { const Profile = () => {
const { user, isLoggedIn } = useContext(AuthenticationContext); const { user } = useContext(AuthenticationContext);
const [groups, setGroups] = useState<Carpool.Group[]>([]); // const [groups, setGroups] = useState<Carpool.Group[]>([]);
const [pools, setPools] = useState<Carpool.Pool[]>([ 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 classes = useStyles(); const classes = useStyles();
useEffect(() => { useEffect(() => {