diff --git a/src/components/CreatePool.tsx b/src/components/CreatePool.tsx index ee8ab1f..11b3902 100644 --- a/src/components/CreatePool.tsx +++ b/src/components/CreatePool.tsx @@ -126,7 +126,7 @@ const CreatePool = () => { onChange={(event) => setType(event.target.value)} > - +
diff --git a/src/components/Groups.tsx b/src/components/Groups.tsx index 2c3c0d1..5ec1e91 100644 --- a/src/components/Groups.tsx +++ b/src/components/Groups.tsx @@ -1,7 +1,51 @@ -import { useState, useEffect } from 'react'; +import Button from '@material-ui/core/Button'; +import React, { useState, useEffect } from 'react'; +import Card from '@material-ui/core/Card'; +import CardActionArea from '@material-ui/core/CardActionArea'; +import CardActions from '@material-ui/core/CardActions'; +import CardContent from '@material-ui/core/CardContent'; +import { makeStyles } from '@material-ui/core/styles'; +import Typography from '@material-ui/core/Typography'; +import CloudUploadIcon from '@material-ui/icons/CloudUpload'; +import Box from '@material-ui/core/Box'; import { makeAPIGetCall } from '../api/utils'; +const useStyles = makeStyles((theme) => ({ + root: { + maxWidth: 345, + justifyContent: 'center', + }, + media: { + height: 140, + }, + button: { + margin: theme.spacing(1), + background: '#40E0D0', + '&:hover': { + background: '#FFFFFF', + }, + }, +})); const Groups = () => { + const classes = useStyles(); + const [state, setState] = useState({ + MyGroups: [ + { + id: 1, + group_title: 'TJ', + }, + ], + }); + + const callAPI = () => { + fetch(`${process.env.REACT_APP_API_ENDPOINT}/groups/`) + .then((response) => response.json()) + .then((data) => { + if (data !== undefined) { + setState(data); + } + }); + }; const [groups, setGroups] = useState([ { _id: '1234', @@ -20,39 +64,76 @@ const Groups = () => { }, []); return ( -
+

Groups

- - Create Group - + + +


+ {groups.map((group, index) => { return ( -
-
-

{group.name}

- -
-
+ + + + {group.name} + + + + + + + + +
+ +
+
+ ); })}
diff --git a/src/components/MyGroups.tsx b/src/components/MyGroups.tsx index ba7cbf5..6756553 100644 --- a/src/components/MyGroups.tsx +++ b/src/components/MyGroups.tsx @@ -1,7 +1,51 @@ +import Button from '@material-ui/core/Button'; import React, { useState, useEffect } from 'react'; +import Card from '@material-ui/core/Card'; +import CardActionArea from '@material-ui/core/CardActionArea'; +import CardActions from '@material-ui/core/CardActions'; +import CardContent from '@material-ui/core/CardContent'; +import { makeStyles } from '@material-ui/core/styles'; +import Typography from '@material-ui/core/Typography'; +import CloudUploadIcon from '@material-ui/icons/CloudUpload'; +import Box from '@material-ui/core/Box'; import { makeAPIGetCall } from '../api/utils'; +const useStyles = makeStyles((theme) => ({ + root: { + maxWidth: 345, + justifyContent: 'center', + }, + media: { + height: 140, + }, + button: { + margin: theme.spacing(1), + background: '#40E0D0', + '&:hover': { + background: '#FFFFFF', + }, + }, +})); const MyGroups = () => { + const classes = useStyles(); + const [state, setState] = useState({ + MyGroups: [ + { + id: 1, + group_title: 'TJ', + }, + ], + }); + + const callAPI = () => { + fetch(`${process.env.REACT_APP_API_ENDPOINT}/groups/`) + .then((response) => response.json()) + .then((data) => { + if (data !== undefined) { + setState(data); + } + }); + }; const [groups, setGroups] = useState([ { _id: '1234', @@ -20,20 +64,26 @@ const MyGroups = () => { }, []); return ( -
+

My Groups

- - Create Group - + + +


{groups.map((group, index) => { @@ -44,14 +94,44 @@ const MyGroups = () => { background = '#FFFFFF'; } return ( - + + + + {group.name} + + + + + + + + + + ); })}