Skip to content

Commit 2785633

Browse files
committed
Edited how the state and class toggles are displayed
1 parent ac1bec6 commit 2785633

File tree

1 file changed

+67
-78
lines changed

1 file changed

+67
-78
lines changed

src/components/LeftColExpansionPanel.tsx

Lines changed: 67 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -122,42 +122,33 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
122122
*/}
123123

124124
{/* LABEL AND TOGGLE(SWITCH) FOR STATEFULNESS */}
125-
{focusedToggle ? (
126-
<InputLabel
127-
htmlFor="stateful"
128-
style={{
129-
color: '#fff',
130-
marginBottom: '10px',
131-
marginTop: '0px',
132-
marginLeft: '11px',
133-
padding: '0px',
134-
fontSize: '18px',
135-
textShadow: '1px 1px 2px rgba(0, 0, 0, 0.7)',
136-
}}
137-
>
138-
State?
139-
</InputLabel>
140-
) : (
141-
''
142-
)}
143125

144126
{focusedToggle ? (
145-
<Switch
146-
checked={stateful}
147-
onChange={e => {
148-
toggleComponentState(id);
149-
changeFocusComponent({ title });
150-
}}
151-
value="stateful"
152-
color="primary"
153-
// id={props.id.toString()}
154-
/>
155-
) : (
156-
''
157-
)}
158-
<div>
159-
{/* LABEL/TOGGLE(SWITCH) FOR CLASS BASED */}
160-
{focusedToggle ? (
127+
<span>
128+
<InputLabel
129+
htmlFor="stateful"
130+
style={{
131+
color: '#fff',
132+
marginBottom: '10px',
133+
marginTop: '0px',
134+
marginLeft: '11px',
135+
padding: '0px',
136+
fontSize: '18px',
137+
textShadow: '1px 1px 2px rgba(0, 0, 0, 0.7)',
138+
}}
139+
>
140+
State?
141+
</InputLabel>
142+
<Switch
143+
checked={stateful}
144+
onChange={e => {
145+
toggleComponentState(id);
146+
changeFocusComponent({ title });
147+
}}
148+
value="stateful"
149+
color="primary"
150+
// id={props.id.toString()}
151+
/>
161152
<InputLabel
162153
htmlFor="classBased"
163154
style={{
@@ -171,11 +162,8 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
171162
}}
172163
>
173164
Class?
174-
</InputLabel>
175-
) : (
176-
''
177-
)}
178-
{focusedToggle ? (
165+
</InputLabel>{' '}
166+
(
179167
<Switch
180168
checked={classBased}
181169
onChange={e => {
@@ -185,48 +173,49 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
185173
value="classBased"
186174
color="primary"
187175
/>
188-
) : (
189-
''
190-
)}
191-
{focusedToggle && component.id !== 1 ? (
192-
<Button
193-
variant="text"
194-
size="small"
195-
color="default"
196-
aria-label="Delete"
197-
className={classes.margin}
198-
onClick={() =>
199-
deleteComponent({
200-
componentId: id,
201-
stateComponents: components,
202-
})
203-
}
176+
</span>
177+
) : (
178+
''
179+
)}
180+
181+
{focusedToggle && component.id !== 1 ? (
182+
<Button
183+
variant="text"
184+
size="small"
185+
color="default"
186+
aria-label="Delete"
187+
className={classes.margin}
188+
onClick={() =>
189+
deleteComponent({
190+
componentId: id,
191+
stateComponents: components,
192+
})
193+
}
194+
style={{
195+
color: 'white',
196+
marginBottom: '0px',
197+
marginTop: '4px',
198+
}}
199+
>
200+
<DeleteIcon
201+
style={{
202+
color: '#b30000',
203+
textShadow: '1px 1px 2px rgba(0, 0, 0, 0.5)',
204+
}}
205+
/>
206+
<div
204207
style={{
205-
color: 'white',
206-
marginBottom: '0px',
207-
marginTop: '4px',
208+
marginTop: '3px',
209+
fontSize: '15px',
210+
textShadow: '1px 1px 2px rgba(0, 0, 0, 0.8)',
208211
}}
209212
>
210-
<DeleteIcon
211-
style={{
212-
color: '#b30000',
213-
textShadow: '1px 1px 2px rgba(0, 0, 0, 0.5)',
214-
}}
215-
/>
216-
<span
217-
style={{
218-
marginTop: '3px',
219-
fontSize: '15px',
220-
textShadow: '1px 1px 2px rgba(0, 0, 0, 0.8)',
221-
}}
222-
>
223-
Delete Component
224-
</span>
225-
</Button>
226-
) : (
227-
''
228-
)}
229-
</div>
213+
Delete Component
214+
</div>
215+
</Button>
216+
) : (
217+
''
218+
)}
230219
</div>
231220
}
232221
style={{ color }}

0 commit comments

Comments
 (0)