Skip to content

Commit 8adf559

Browse files
committed
Cleaned up component cards
1 parent 2e73814 commit 8adf559

File tree

2 files changed

+42
-11
lines changed

2 files changed

+42
-11
lines changed

src/components/LeftColExpansionPanel.tsx

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import AddIcon from '@material-ui/icons/Add';
1010
import DeleteIcon from '@material-ui/icons/Delete';
1111
import Button from '@material-ui/core/Button';
1212
import Tooltip from '@material-ui/core/Tooltip';
13+
import Collapse from '@material-ui/core/Collapse';
1314
import Switch from '@material-ui/core/Switch'; // for state/class toggling
1415
import InputLabel from '@material-ui/core/InputLabel'; // labeling of state/class toggles
1516

@@ -26,9 +27,10 @@ interface LeftColExpPanPropsInt extends PropsInt {
2627
toggleComponentClass(arg: number): void;
2728
}
2829

29-
interface TypographyProps {
30-
type: string;
31-
}
30+
//interface created but never used
31+
// interface TypographyProps {
32+
// type: string;
33+
// }
3234

3335
// TODO: ASSIGN SPECIFIC TYPING TO INCOMING PROPS (REMOVE ANY)
3436
const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
@@ -62,11 +64,12 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
6264
className={classes.root}
6365
style={
6466
// 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)'} : {}
6668
}
6769
>
6870
{/* 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'}}>
7073
<List style={{ color: 'red' }}>
7174
<ListItem
7275
// button // commented out to disable materialUI hover shading effect. TBD if any adverse effects occur
@@ -84,8 +87,8 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
8487
//type='body2'
8588
style={{
8689
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',
8992
}}
9093
>
9194
{title}
@@ -141,7 +144,8 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
141144
marginTop: '0px',
142145
marginLeft: '11px',
143146
padding: '0px',
144-
fontSize: '18px'
147+
fontSize: '18px',
148+
textShadow: '1px 1px 2px rgba(0, 0, 0, 0.7)'
145149
}}
146150
>
147151
Class?
@@ -162,6 +166,31 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
162166
) : (
163167
''
164168
)}
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+
) : ('')}
165194
</div>
166195
</div>
167196
}
@@ -170,7 +199,9 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
170199
</ListItem>
171200
</List>
172201
</Grid>
173-
{id === 1 || !isFocused() ? (
202+
</Collapse>
203+
{/* {id === 1 || !isFocused() ? ( Removed sepearate delete icon and
204+
made it part of card
174205
<div />
175206
) : (
176207
<Fragment>
@@ -198,7 +229,7 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
198229
<span style={{ marginTop: '3px' }}>Delete Component</span>
199230
</Button>
200231
</Fragment>
201-
)}
232+
)} */}
202233
</div>
203234
</Grid>
204235

src/utils/colors.util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const colors: string[] = [
88
'#f64c72',
99
'#c99261',
1010
'#355586',
11-
'#5cdb95',
11+
'#52C586',
1212
'#7395ae',
1313
'#981d5c',
1414
'#556738',

0 commit comments

Comments
 (0)