11import React , { useContext , useEffect , useState } from 'react' ;
2- import { Grid , IconButton , Modal , Paper } from '@material-ui/core' ;
2+ import {
3+ IconButton ,
4+ Grid ,
5+ Modal ,
6+ Card ,
7+ CardHeader ,
8+ CardContent ,
9+ Typography ,
10+ } from '@material-ui/core' ;
311import DeleteForeverOutlinedIcon from '@material-ui/icons/DeleteForeverOutlined' ;
412import { makeStyles } from '@material-ui/core/styles' ;
513import { DashboardContext } from '../context/DashboardContext' ;
614
715import ServicesModal from '../modals/ServicesModal' ;
16+ import '../stylesheets/Applications.css' ;
817
918const Applications = ( ) => {
1019 const { applications, getApplications, deleteApp } = useContext ( DashboardContext ) ;
@@ -26,54 +35,71 @@ const Applications = () => {
2635 const handleClick = ( selectedApp : string , i : number ) => {
2736 setIndex ( i ) ;
2837 setApp ( selectedApp ) ;
29- console . log ( 'handle' , selectedApp )
38+ console . log ( 'handle' , selectedApp ) ;
3039 setOpen ( true ) ;
3140 } ;
3241
3342 const useStyles = makeStyles ( theme => ( {
3443 paper : {
3544 height : 340 ,
3645 textAlign : 'center' ,
37- color : 'white' ,
38- fontSize : '3rem' ,
46+ color : 'rgba(33, 34, 41, 1.2)' ,
3947 whiteSpace : 'nowrap' ,
40- background : 'rgb (33, 34, 41)' ,
41- border : '2px solid black ' ,
42- boxShadow : '0 3px 5px 2px rgba(255, 105, 135, .3 )' ,
43- marginBottom : theme . spacing ( 1 ) ,
48+ backgroundColor : 'rgba (33, 34, 41, 0.2 )' ,
49+ border : '3px ridge #808080 ' ,
50+ boxShadow : '0 10px 10px rgba(0,0,0,0.5 )' ,
51+ '&:hover, &.Mui-focusVisible' : { color : 'white' , background : 'rgba(33, 34, 41, 1.2)' } ,
4452 } ,
4553 hover : {
4654 position : 'relative' ,
47- top : '5%' ,
48- right : '5%' ,
49- height : 120 ,
50- width : 120 ,
55+ bottom : 20 ,
56+ right : 40 ,
5157 boxShadow : 'none' ,
5258 '&:hover, &.Mui-focusVisible' : { color : 'red' } ,
5359 } ,
60+ btnStyle : {
61+ position : 'relative' ,
62+ top : 50 ,
63+ margin : '0 auto' ,
64+ color : 'rgb(255, 243, 72)' ,
65+ backgroundColor : 'grey' ,
66+ } ,
67+ fontStyles : {
68+ fontSize : '3rem' ,
69+ [ theme . breakpoints . up ( 'lg' ) ] : {
70+ fontSize : '2.75rem' ,
71+ } ,
72+ } ,
5473 } ) ) ;
5574
5675 const classes = useStyles ( ) ;
5776
5877 return (
5978 < >
6079 { applications . map ( ( app : string [ ] , i : number | any | string | undefined ) => (
61- < Grid item xs = { 6 } key = { i } >
62- < Paper
63- className = { classes . paper }
64- id = { i }
65- key = { i }
66- onClick = { ( event : React . MouseEvent < HTMLElement > ) => handleClick ( app [ 0 ] , i ) }
67- >
68- { app [ 0 ] }
69- < IconButton
70- aria-label = "Delete"
71- onClick = { ( event : React . MouseEvent < HTMLElement > ) => confirmDelete ( app [ 0 ] , i ) }
72- color = "primary"
80+ < Grid item lg = { 4 } md = { 6 } sm = { 12 } key = { i } >
81+ < div id = "card-hover" >
82+ < Card
83+ className = { classes . paper }
84+ variant = "outlined"
85+ onClick = { ( event : React . MouseEvent < HTMLElement > ) => handleClick ( app [ 0 ] , i ) }
7386 >
74- < DeleteForeverOutlinedIcon className = { classes . hover } />
75- </ IconButton >
76- </ Paper >
87+ < CardHeader
88+ avatar = {
89+ < IconButton
90+ className = { classes . hover }
91+ aria-label = "Delete"
92+ onClick = { ( event : React . MouseEvent < HTMLElement > ) => confirmDelete ( app [ 0 ] , i ) }
93+ >
94+ < DeleteForeverOutlinedIcon />
95+ </ IconButton >
96+ }
97+ > </ CardHeader >
98+ < CardContent >
99+ < Typography className = { classes . fontStyles } > { app [ 0 ] } </ Typography >
100+ </ CardContent >
101+ </ Card >
102+ </ div >
77103 </ Grid >
78104 ) ) }
79105 < Modal open = { open } onClose = { ( ) => setOpen ( false ) } >
@@ -84,3 +110,8 @@ const Applications = () => {
84110} ;
85111
86112export default Applications ;
113+
114+ //name, desc, creation date
115+ // three cards a row, same width
116+ // move trash can
117+ //change the font
0 commit comments