Skip to content

Commit 0c719a7

Browse files
committed
Modified create component menu styling and added a few comments for readability/understanding
1 parent 2406418 commit 0c719a7

File tree

4 files changed

+6075
-1266
lines changed

4 files changed

+6075
-1266
lines changed

app/src/components/left/DragDropPanel.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable max-len */
2+
// THIS IS THE ADD COMPONENT MENU FROM WHERE COMPONENTS ARE CLICKED AND DRAGGED TO BE PLACED ON THE CANVAS
23
import { useDispatch, useSelector } from 'react-redux';
34
import Grid from '@mui/material/Grid';
45
import React from 'react';
@@ -74,7 +75,7 @@ const DragDropPanel = (props): JSX.Element => {
7475
id="panel1a-header"
7576
className={classes.accordionSummary}
7677
>
77-
<h3>Root Components</h3>
78+
<h3>Root</h3>
7879
</AccordionSummary>
7980
<AccordionDetails>
8081
<ComponentDrag isVisible={true} isThemeLight={props.isThemeLight} />
@@ -89,16 +90,16 @@ const DragDropPanel = (props): JSX.Element => {
8990
id="panel1a-header"
9091
className={classes.accordionSummary}
9192
>
92-
<h3>HTML Elements</h3>
93+
<h3>Containers</h3>
9394
</AccordionSummary>
9495
<AccordionDetails
9596
sx={{
9697
display: 'flex',
97-
justifyContent: 'center',
98-
alignItems: 'space-around',
98+
justifyContent: 'column',
99+
alignItems: 'center',
99100
}}
100101
>
101-
<Grid container justifyContent="space-around" columnSpacing={2}>
102+
<Grid container direction="column" spacing={2}>
102103
{htmlTypesToRender.map((option) => {
103104
if (
104105
!['Switch', 'LinkTo', 'LinkHref', 'Image', 'Route'].includes(
@@ -133,11 +134,11 @@ const DragDropPanel = (props): JSX.Element => {
133134
<AccordionDetails
134135
sx={{
135136
display: 'flex',
136-
justifyContent: 'center',
137-
alignItems: 'space-around',
137+
justifyContent: 'column',
138+
alignItems: 'center',
138139
}}
139140
>
140-
<Grid container justifyContent="space-around" columnSpacing={2}>
141+
<Grid container direction="column" spacing={2}>
141142
{htmlTypesToRender.map((option) => {
142143
if (
143144
(option.name === 'Switch' ||

app/src/public/styles/style.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ span.material-symbols-outlined {
121121
padding: 0px;
122122
display: flex;
123123
height: 100%;
124-
width: 280px;
125-
min-width: 225px;
124+
width: 200px;
125+
min-width: 140px;
126126
flex-direction: column;
127127
align-content: center;
128128
position: relative;
@@ -218,14 +218,16 @@ span.material-symbols-outlined {
218218
display: flex;
219219
}
220220

221+
/* THIS IS STYLING THE BUTTONS ON THE CREATE MENU */
221222
#HTMLItem {
223+
justify-content: flex-start;
222224
transition: 0.3s;
223225
border: 1px solid transparent;
224226
color: #f2fbf8;
225-
padding: 10%;
227+
padding: 0%;
226228
border-radius: 10px;
227229
box-shadow: #191919;
228-
width: 120px;
230+
width: 110px;
229231
overflow: hidden;
230232
text-overflow: clip;
231233
white-space: nowrap;

app/src/redux/store.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ import rootReducer from './reducers/rootReducer';
2828
* Defines a type representing the Redux store itself for use in typing contexts where the store object is used.
2929
*/
3030
const store = configureStore({
31-
reducer: rootReducer,
31+
reducer: rootReducer, // combine all reducers into one rootReducer
3232
middleware: (getDefaultMiddleware) => {
3333
let ignoredPaths: string[] = [];
3434

35-
for (let i = 0; i < 21; i++) {
35+
for (let i = 0; i < 21; i++) { // iterate through paths of the state and ignore specific properties from serializability checks
3636
ignoredPaths.push(`appState.HTMLTypes.${i}.icon`);
3737
ignoredPaths.push(`appState.HTMLTypes.${i}.icon.$$typeof`);
3838
}
3939

40-
return getDefaultMiddleware({
40+
return getDefaultMiddleware({ // return getDefaultMiddleware but with customized serializability check
4141
serializableCheck: {
42-
ignoredPaths,
42+
ignoredPaths, // specified paths to be ignored for serializability checks
4343
},
4444
});
4545
},

0 commit comments

Comments
 (0)