made cards clickable and added links #9
This commit is contained in:
@@ -4,6 +4,11 @@ import Card from '@material-ui/core/Card';
|
|||||||
import CardContent from '@material-ui/core/CardContent';
|
import CardContent from '@material-ui/core/CardContent';
|
||||||
import Typography from '@material-ui/core/Typography';
|
import Typography from '@material-ui/core/Typography';
|
||||||
import Grid from '@material-ui/core/Grid';
|
import Grid from '@material-ui/core/Grid';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import Link1 from '@material-ui/core/Link';
|
||||||
|
import ListItem from '@material-ui/core/ListItem';
|
||||||
|
import ListItemText from '@material-ui/core/ListItemText';
|
||||||
|
|
||||||
|
|
||||||
const useStyles = makeStyles(theme => ({
|
const useStyles = makeStyles(theme => ({
|
||||||
card: {
|
card: {
|
||||||
@@ -12,13 +17,16 @@ const useStyles = makeStyles(theme => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
function CreateResourceCard(resource, classes) {
|
function CreateResourceCard(resource, classes) {
|
||||||
|
function ListItemLink(props) {
|
||||||
|
return <ListItem button component={Link1} {...props} />;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Grid item xs={4}>
|
<Grid item xs={4} lg={2} >
|
||||||
<Card className={classes.card}>
|
<Card >
|
||||||
<CardContent>
|
<CardContent style={{ padding: 0 }}>
|
||||||
<Typography variant="h6" component="h2">
|
<ListItemLink to={"/" + resource["name"].toLowerCase()} component={Link}>
|
||||||
{resource["name"]}
|
<ListItemText primary={resource["name"]} />
|
||||||
</Typography>
|
</ListItemLink>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Reference in New Issue
Block a user