@@ -10,6 +10,7 @@ import AddIcon from '@material-ui/icons/Add';
10
10
import DeleteIcon from '@material-ui/icons/Delete' ;
11
11
import Button from '@material-ui/core/Button' ;
12
12
import Tooltip from '@material-ui/core/Tooltip' ;
13
+ import Collapse from '@material-ui/core/Collapse' ;
13
14
import Switch from '@material-ui/core/Switch' ; // for state/class toggling
14
15
import InputLabel from '@material-ui/core/InputLabel' ; // labeling of state/class toggles
15
16
@@ -26,9 +27,10 @@ interface LeftColExpPanPropsInt extends PropsInt {
26
27
toggleComponentClass ( arg : number ) : void ;
27
28
}
28
29
29
- interface TypographyProps {
30
- type : string ;
31
- }
30
+ //interface created but never used
31
+ // interface TypographyProps {
32
+ // type: string;
33
+ // }
32
34
33
35
// TODO: ASSIGN SPECIFIC TYPING TO INCOMING PROPS (REMOVE ANY)
34
36
const LeftColExpansionPanel = ( props : LeftColExpPanPropsInt ) => {
@@ -62,11 +64,12 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
62
64
className = { classes . root }
63
65
style = {
64
66
// shadow to highlight the focused component card
65
- focusedToggle ? { boxShadow : '4px 4px 4px rgba(0, 0, 0, .4)' } : { }
67
+ focusedToggle ? { boxShadow : '4px 4px 4px rgba(0, 0, 0, .4)' } : { }
66
68
}
67
69
>
68
70
{ /* NOT SURE WHY COLOR: RED IS USED, TRIED REMOVING IT AND NO VISIBLE CHANGE OCCURED */ }
69
- < Grid item xs = { 12 } style = { { color : 'red' , backgroundColor : color } } >
71
+ < Collapse in = { focusedToggle } collapsedHeight = { 70 } >
72
+ < Grid item xs = { 12 } style = { { color : 'red' , backgroundColor : color , borderRadius : '10px' } } >
70
73
< List style = { { color : 'red' } } >
71
74
< ListItem
72
75
// button // commented out to disable materialUI hover shading effect. TBD if any adverse effects occur
@@ -84,8 +87,8 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
84
87
//type='body2'
85
88
style = { {
86
89
color : '#fff' ,
87
- textShadow : '1px 1px 2px rgba(0, 0, 0, 0.2 )' ,
88
- fontSize : '1.40rem'
90
+ textShadow : '1px 1px 2px rgba(0, 0, 0, 0.7 )' ,
91
+ fontSize : '1.40rem' ,
89
92
} }
90
93
>
91
94
{ title }
@@ -141,7 +144,8 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
141
144
marginTop : '0px' ,
142
145
marginLeft : '11px' ,
143
146
padding : '0px' ,
144
- fontSize : '18px'
147
+ fontSize : '18px' ,
148
+ textShadow : '1px 1px 2px rgba(0, 0, 0, 0.7)'
145
149
} }
146
150
>
147
151
Class?
@@ -162,6 +166,31 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
162
166
) : (
163
167
''
164
168
) }
169
+ { focusedToggle ? (
170
+ < Button
171
+ variant = "text"
172
+ size = "small"
173
+ color = "default"
174
+ aria-label = "Delete"
175
+ className = { classes . margin }
176
+ onClick = { ( ) =>
177
+ deleteComponent ( {
178
+ componentId : id ,
179
+ stateComponents : components
180
+ } )
181
+ }
182
+ style = { {
183
+ color : '#D3D3D3' ,
184
+ marginBottom : '0px' ,
185
+ marginTop : '4px' ,
186
+ marginLeft : '0px' ,
187
+ padding : '0px' ,
188
+ } }
189
+ >
190
+ < DeleteIcon style = { { color : '#e25848' , textShadow :'1px 1px 2px rgba(0, 0, 0, 0.5)' } } />
191
+ < span style = { { marginTop : '3px' , textShadow : '1px 1px 2px rgba(0, 0, 0, 0.5)' } } > Delete Component</ span >
192
+ </ Button >
193
+ ) : ( '' ) }
165
194
</ div >
166
195
</ div >
167
196
}
@@ -170,7 +199,9 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
170
199
</ ListItem >
171
200
</ List >
172
201
</ Grid >
173
- { id === 1 || ! isFocused ( ) ? (
202
+ </ Collapse >
203
+ { /* {id === 1 || !isFocused() ? ( Removed sepearate delete icon and
204
+ made it part of card
174
205
<div />
175
206
) : (
176
207
<Fragment>
@@ -198,7 +229,7 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
198
229
<span style={{ marginTop: '3px' }}>Delete Component</span>
199
230
</Button>
200
231
</Fragment>
201
- ) }
232
+ )} */ }
202
233
</ div >
203
234
</ Grid >
204
235
0 commit comments