better form ui

This commit is contained in:
Joshua Hsueh 2021-04-10 21:21:08 -04:00
commit 5269d9b889
2 changed files with 17 additions and 14 deletions

View File

@ -1,4 +1,3 @@
import { FormEventHandler } from 'react';
import { makeAPIPostCall } from '../api/utils'; import { makeAPIPostCall } from '../api/utils';
import Card from '@material-ui/core/Card'; import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent'; import CardContent from '@material-ui/core/CardContent';
@ -18,6 +17,7 @@ const useStyles = makeStyles((theme) => ({
margin: theme.spacing(1), margin: theme.spacing(1),
}, },
})); }));
const CreatePool = () => { const CreatePool = () => {
const [title, setTitle] = useState('No Title'); const [title, setTitle] = useState('No Title');
const [capacity, setCapacity] = useState(0); const [capacity, setCapacity] = useState(0);
@ -27,25 +27,18 @@ const CreatePool = () => {
const [type, setType] = useState('offer'); const [type, setType] = useState('offer');
const [description, setDescription] = useState(''); const [description, setDescription] = useState('');
const classes = useStyles(); const classes = useStyles();
const [group, setGroup] = useState('');
const onClick = () => { const onClick = () => {
console.log({
title: title,
description: description,
start_time: start,
end_time: end,
capacity,
direction,
type,
});
makeAPIPostCall('/pool', { makeAPIPostCall('/pool', {
title: title, title,
description: description, description,
start_time: start, start_time: start,
end_time: end, end_time: end,
capacity, capacity,
direction, direction,
type, type,
group_id: group,
}); });
}; };
useEffect(() => {}, []); useEffect(() => {}, []);
@ -155,7 +148,17 @@ const CreatePool = () => {
placeholder="Enter text here..." placeholder="Enter text here..."
/> />
</div> </div>
<div className="form-group">
<label className="" htmlFor="pool_start">
Group:
</label>
<input
type="text"
className="form-control"
placeholder=""
onChange={(event) => setGroup(event.target.value)}
></input>
</div>
<Button <Button
variant="contained" variant="contained"
color="primary" color="primary"

View File

@ -74,7 +74,7 @@ export default function Group() {
}} }}
> >
<Typography variant="h1" align="center"> <Typography variant="h1" align="center">
Group {group.id} {group.name}
</Typography> </Typography>
<Typography variant="h3" align="center"> <Typography variant="h3" align="center">