Skip to content

Commit 8875929

Browse files
committed
Align Cards and Add Card Actions
1 parent abdd729 commit 8875929

2 files changed

Lines changed: 24 additions & 30 deletions

File tree

app/components/Applications.tsx

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
import React, { useContext, useEffect, useState } from 'react';
2-
import {
3-
Button,
4-
Grid,
5-
IconButton,
6-
Modal,
7-
Paper,
8-
Card,
9-
CardHeader,
10-
CardContent,
11-
} from '@material-ui/core';
2+
import { Button, Grid, Modal, Card, CardHeader, CardContent, CardActions } from '@material-ui/core';
123
import DeleteForeverOutlinedIcon from '@material-ui/icons/DeleteForeverOutlined';
134
import { makeStyles } from '@material-ui/core/styles';
145
import { DashboardContext } from '../context/DashboardContext';
@@ -48,13 +39,19 @@ const Applications = () => {
4839
background: 'rgb(33, 34, 41)',
4940
border: '2px solid black',
5041
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
51-
marginBottom: theme.spacing(1),
5242
},
5343
hover: {
5444
color: 'white',
5545
boxShadow: 'none',
5646
'&:hover, &.Mui-focusVisible': { color: 'red' },
5747
},
48+
btnStyle: {
49+
position: 'relative',
50+
top: 50,
51+
margin: '0 auto',
52+
color: 'rgb(255, 243, 72)',
53+
backgroundColor: 'grey',
54+
},
5855
}));
5956

6057
const classes = useStyles();
@@ -63,7 +60,11 @@ const Applications = () => {
6360
<>
6461
{applications.map((app: string, i: number | any | string | undefined) => (
6562
<Grid item xs={6} key={i}>
66-
<Card className={classes.paper}>
63+
<Card
64+
className={classes.paper}
65+
variant="outlined"
66+
onClick={(event: React.MouseEvent<HTMLElement>) => handleClick(app, i)}
67+
>
6768
<CardHeader
6869
avatar={
6970
<Button
@@ -73,6 +74,11 @@ const Applications = () => {
7374
}
7475
></CardHeader>
7576
<CardContent>{app}</CardContent>
77+
<CardActions>
78+
<Button className={classes.btnStyle} size="large">
79+
Click to View
80+
</Button>
81+
</CardActions>
7682
</Card>
7783
</Grid>
7884
))}
@@ -84,19 +90,3 @@ const Applications = () => {
8490
};
8591

8692
export default Applications;
87-
88-
// <IconButton
89-
// className={classes.btnStyle}
90-
// aria-label="Delete"
91-
// onClick={(event: React.MouseEvent<HTMLElement>) => confirmDelete(app, i)}
92-
// color="primary"
93-
// >
94-
// <DeleteForeverOutlinedIcon className={classes.hover} />
95-
// </IconButton>
96-
97-
// <Paper
98-
// className={classes.paper}
99-
// id={i}
100-
// key={i}
101-
// onClick={(event: React.MouseEvent<HTMLElement>) => handleClick(app, i)}
102-
// >

app/components/Occupied.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ const Occupied: React.FC = () => {
1414
paper: {
1515
color: theme.palette.text.secondary,
1616
height: 340,
17+
top: 10,
18+
width: '49%',
19+
marginLeft: '.5%',
1720
background: 'rgb(33, 34, 41)',
1821
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
1922
'&:hover, &.Mui-focusVisible': { background: 'rgb(33, 34, 41)' },
2023
},
2124
grid: {
2225
margin: '0 auto',
2326
maxWidth: '75vw',
27+
maxHeight: '75vh',
2428
},
2529
icon: {
2630
width: '100px',
@@ -31,6 +35,7 @@ const Occupied: React.FC = () => {
3135
},
3236
heroContent: {
3337
padding: theme.spacing(8, 0, 6),
38+
backgroundColor: '#e8e8e8',
3439
},
3540
}));
3641

@@ -40,7 +45,6 @@ const Occupied: React.FC = () => {
4045
<div>
4146
<Typography
4247
className={classes.heroContent}
43-
// component="h1"
4448
variant="h1"
4549
align="center"
4650
color="textPrimary"
@@ -52,10 +56,10 @@ const Occupied: React.FC = () => {
5256
<AddModal setOpen={setOpen} />
5357
</Modal>
5458
<Grid className={classes.grid} container spacing={3}>
59+
<Applications />
5560
<Button className={classes.paper} onClick={() => setOpen(true)}>
5661
<AddCircleOutlineTwoToneIcon className={classes.icon} />
5762
</Button>
58-
<Applications />
5963
</Grid>
6064
</div>
6165
);

0 commit comments

Comments
 (0)