Skip to content

Commit 6a89da4

Browse files
committed
style changes
1 parent 5285a73 commit 6a89da4

File tree

3 files changed

+60
-63
lines changed

3 files changed

+60
-63
lines changed

app/src/components/left/CreateContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const CreateContainer = (props): JSX.Element => {
7070
justifyContent: 'top',
7171
color: '#f7f4dc',
7272
textAlign: 'center',
73-
marginLeft: '15px',
73+
marginLeft: '15px'
7474
}}
7575
>
7676
<CreateMenu />

app/src/components/left/CreateMenu.tsx

Lines changed: 42 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import DeleteIcon from '@mui/icons-material/Delete';
2020
import InsertPhoto from '@mui/icons-material/InsertPhoto';
2121
import MUIItem from './MUIItem';
2222
import HTMLItem from './HTMLItem';
23-
import HTMLPanel from "./HTMLPanel";
23+
import HTMLPanel from './HTMLPanel';
2424
import ComponentDrag from './ComponentDrag';
2525

2626
/**
@@ -42,15 +42,15 @@ const CreateMenu = (props): JSX.Element => {
4242

4343
const [menuAnchor, setMenuAnchor] = React.useState<null | HTMLElement>(null);
4444
const [activeCategory, setActiveCategory] = React.useState<string | null>(
45-
null,
45+
null
4646
);
4747
const [menuLocked, setMenuLocked] = useState(false);
4848

4949
const [isCreatingModule, setCreateModule] = useState(false);
5050
const [MUIMode, setMUIMode] = useState(false);
5151
const handleMenuOpen = (
5252
event: React.MouseEvent<HTMLButtonElement>,
53-
category: string,
53+
category: string
5454
) => {
5555
setActiveCategory(category);
5656
setMenuAnchor(event.currentTarget);
@@ -81,24 +81,23 @@ const CreateMenu = (props): JSX.Element => {
8181
if (roomCode) {
8282
emitEvent('deleteElementAction', roomCode, {
8383
id,
84-
contextParam,
84+
contextParam
8585
});
8686
}
8787
};
8888

8989
const handleClickAdd = () => {
9090
setCreateModule(true);
9191
};
92-
// create a function to which you can pass in an array of strings, search
93-
// both state.HTMLTypes and state.MUITypes to see if any of their type.names match
94-
// an item in the array and return the item if so, depending on which list it originates from.
9592

9693
const handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {
9794
if (event.key === 'Enter') {
9895
handleClickAdd();
9996
}
10097
};
101-
98+
// create a function to which you can pass in an array of strings, search
99+
// both state.HTMLTypes and state.MUITypes to see if any of their type.names match
100+
// an item in the array and return the item if so, depending on which list it originates from.
102101
const findTypes = function (array) {
103102
if (MUIMode === true)
104103
return state.HTMLTypes.filter((type) => array.includes(type.name))
@@ -121,7 +120,7 @@ const CreateMenu = (props): JSX.Element => {
121120
icon={option.icon}
122121
handleDelete={handleDelete}
123122
/>
124-
),
123+
)
125124
)
126125
);
127126
else
@@ -134,7 +133,7 @@ const CreateMenu = (props): JSX.Element => {
134133
icon={option.icon}
135134
handleDelete={handleDelete}
136135
/>
137-
),
136+
)
138137
);
139138
};
140139
const HTMLElements = findTypes([
@@ -144,7 +143,7 @@ const CreateMenu = (props): JSX.Element => {
144143
'Header 2',
145144
'Span',
146145
'Label',
147-
'Link',
146+
'Link'
148147
]);
149148

150149
const InputElements = findTypes(['Input', 'Form', 'Button']);
@@ -153,7 +152,7 @@ const CreateMenu = (props): JSX.Element => {
153152
'Icon',
154153
'Avatar',
155154
'Badge',
156-
'Img',
155+
'Img'
157156
]);
158157

159158
const textComponents = findTypes([
@@ -162,7 +161,7 @@ const CreateMenu = (props): JSX.Element => {
162161
'Header 2',
163162
'Span',
164163
'Label',
165-
'Link',
164+
'Link'
166165
]);
167166

168167
// create containers - box/container/stack
@@ -172,7 +171,7 @@ const CreateMenu = (props): JSX.Element => {
172171
'Box',
173172
'Container',
174173
'Stack',
175-
'Dividers',
174+
'Dividers'
176175
]);
177176

178177
// create buttons -- button/floating button/chips
@@ -188,25 +187,25 @@ const CreateMenu = (props): JSX.Element => {
188187
'Checkbox',
189188
'Switch',
190189
'Rating',
191-
'Slider',
190+
'Slider'
192191
]);
193192

194193
// create lists - OL, UL, LI, TransferList
195194

196-
const lists = findTypes(['Ordered List', 'Unordered List', 'List']);
195+
const lists = findTypes(['Ordered List', 'List', 'Unordered List']);
197196
//create forms -- Form, ButtonGroup, ToggleButtonGroup, Select, AutoComplete
198197
const HTMLlists = findTypes([
199198
'Ordered List',
200-
'Unordered List',
201199
'List',
202-
'Menu',
200+
'Unordered List',
201+
'Menu'
203202
]);
204203
const forms = findTypes([
205204
'Form',
206205
'ButtonGroup',
207206
'ToggleButtonGroup',
208207
'Select',
209-
'AutoComplete',
208+
'AutoComplete'
210209
]);
211210
// create displays --- Modal, POpover, Popper, Transition
212211
const displays = findTypes(['Modal', 'Popover', 'Popper', 'Transition']);
@@ -218,7 +217,7 @@ const CreateMenu = (props): JSX.Element => {
218217
'AppBar',
219218
'Tabs',
220219
'Card',
221-
'Paper',
220+
'Paper'
222221
]);
223222
// create navigation -- menu, bottomnav, breadcrumbs, drawer, stepper, tabs, speeddial
224223
const navComponents = findTypes([
@@ -227,7 +226,7 @@ const CreateMenu = (props): JSX.Element => {
227226
'Breadcrumbs',
228227
'Drawer',
229228
'Stepper',
230-
'Speed Dial',
229+
'Speed Dial'
231230
]);
232231

233232
const makeMenuCategory = function (typeArray, name, idx) {
@@ -236,14 +235,10 @@ const CreateMenu = (props): JSX.Element => {
236235
<Box
237236
sx={{
238237
fontSize: '2rem',
239-
textAlign: 'center',
238+
textAlign: 'center'
240239
}}
241240
>
242-
<Button
243-
component="label"
244-
id={name + '-button'}
245-
key={name + idx}
246-
>
241+
<Button component="label" id={name + '-button'} key={name + idx}>
247242
{name}
248243
</Button>
249244
</Box>
@@ -268,46 +263,40 @@ const CreateMenu = (props): JSX.Element => {
268263
icon={option.icon}
269264
handleDelete={handleDelete}
270265
/>
271-
)),
266+
))
272267
])}
273268
<FormGroup>
274269
<Box display="flex" alignItems="center" justifyContent="center">
275-
<p style={{ fontSize: '0.8rem' }}>HTML</p>
270+
<p className="smallerText blueText">HTML</p>
276271
<Switch
277272
checked={MUIMode}
278273
onChange={() => setMUIMode(!MUIMode)}
279274
inputProps={{ 'aria-label': 'HTML + MUI switch' }}
280275
sx={{ margin: '0 10px' }} // Adjust spacing between text and switch
281276
/>
282-
<p style={{ fontSize: '0.8rem' }}>HTML + MUI</p>
277+
<p className="smallerText">
278+
<span className="blueText">HTML + </span>
279+
<span className="switchText-MUI orangeText"> MUI</span>
280+
</p>
283281
</Box>
284-
{/* <FormControlLabel
285-
control={
286-
<Switch
287-
checked={MUIMode}
288-
onChange={() => MUIMode === true ? setMUIMode(false) : setMUIMode(true)}
289-
/>
290-
}
291-
label={MUIMode ? 'HTML + MUI' : 'HTML'}
292-
/> */}
293282
</FormGroup>
294283
{MUIMode
295284
? [
296-
[visualComponents, 'visual'],
297-
[containers, 'containers'],
298-
[buttons, 'buttons'],
299-
[textComponents, 'text'],
300-
[lists, 'lists'],
301-
[displays, 'displays'],
302-
[layouts, 'layouts'],
303-
[forms, 'forms'],
304-
[navComponents, 'navigation'],
305-
].map((item, idx) => makeMenuCategory(item[0], item[1], idx))
285+
[visualComponents, 'visual'],
286+
[containers, 'containers'],
287+
[buttons, 'buttons'],
288+
[textComponents, 'text'],
289+
[lists, 'lists'],
290+
[displays, 'displays'],
291+
[layouts, 'layouts'],
292+
[forms, 'forms'],
293+
[navComponents, 'navigation']
294+
].map((item, idx) => makeMenuCategory(item[0], item[1], idx))
306295
: [
307-
[HTMLElements, 'Text and Visual'],
308-
[InputElements, 'Forms and Inputs'],
309-
[HTMLlists, 'lists'],
310-
].map((item, idx) => makeMenuCategory(item[0], item[1], idx))}
296+
[HTMLElements, 'Text and Visual'],
297+
[InputElements, 'Forms and Inputs'],
298+
[HTMLlists, 'lists']
299+
].map((item, idx) => makeMenuCategory(item[0], item[1], idx))}
311300
</div>
312301
);
313302
};

app/src/public/styles/style.css

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ span.material-symbols-outlined {
131131
padding: 0px;
132132
display: flex;
133133
height: 100%;
134-
width: 240px;
135-
min-width: 140px;
134+
width: 282px;
135+
min-width: 282px;
136136
flex-direction: column;
137137
align-content: center;
138138
position: relative;
@@ -237,22 +237,19 @@ span.material-symbols-outlined {
237237
padding: 10%;
238238
border-radius: 10px;
239239
box-shadow: #191919;
240-
width: 110px;
241-
overflow: hidden;
242-
text-overflow: clip;
240+
width: 120px;
243241
white-space: nowrap;
244242
}
245243

246244
#HTMLItem:hover {
247245
background-color: #474545a8;
248246
color: #8ca8ff;
247+
border-radius: 4px;
249248
}
250249

251250
/* placeholder until button resizing */
252251
#MUIItem {
253-
overflow: hidden;
254-
text-overflow: clip;
255-
white-space: nowrap;
252+
white-space: wrap;
256253
transition: 0.3s;
257254
border: 1px solid transparent;
258255
color: #f2fbf8;
@@ -262,9 +259,20 @@ span.material-symbols-outlined {
262259
width: 110px;
263260
}
264261

262+
.smallerText {
263+
font-size: 0.8rem;
264+
}
265+
266+
.blueText {
267+
color: #8ca8ff;
268+
}
269+
270+
.orangeText {
271+
color: #f08c00;
272+
}
265273
#MUIItem:hover {
266274
background-color: #474545a8;
267-
color: #8ca8ff;
275+
color: #f08c00;
268276
}
269277

270278
#submitButton {

0 commit comments

Comments
 (0)