1
1
import { useDispatch , useSelector } from 'react-redux' ;
2
2
import Grid from '@mui/material/Grid' ;
3
3
import HTMLItem from './HTMLItem' ;
4
+ import MUIItem from './MUI_Item' ;
4
5
import React from 'react' ;
5
6
import { RootState } from '../../redux/store' ;
6
7
import { deleteElement } from '../../redux/reducers/slice/appStateSlice' ;
@@ -10,18 +11,17 @@ import AccordionSummary from '@mui/material/AccordionSummary';
10
11
import AccordionDetails from '@mui/material/AccordionDetails' ;
11
12
import ExpandMoreIcon from '@mui/icons-material/ExpandMore' ;
12
13
import { makeStyles } from '@mui/styles' ;
13
- import ComponentDrag from './ComponentDrag' ;
14
-
14
+ import ComponentDrag from './ComponentDrag' ;
15
15
16
16
const useStyles = makeStyles ( {
17
17
accordion : {
18
18
backgroundColor : '#000000' , // Set the background color to gray
19
- color : '#ffffff' , // Set the text color to white
19
+ color : '#ffffff' // Set the text color to white
20
20
} ,
21
21
accordionSummary : {
22
22
backgroundColor : '#000000' , // Set the background color of the summary to gray
23
- color : '#ffffff' , // Set the text color of the summary to white
24
- } ,
23
+ color : '#ffffff' // Set the text color of the summary to white
24
+ }
25
25
} ) ;
26
26
27
27
const DragDropPanel = ( props ) : JSX . Element => {
@@ -46,6 +46,8 @@ const DragDropPanel = (props): JSX.Element => {
46
46
( type ) => type . name !== 'separator'
47
47
) ;
48
48
49
+ const muiTypesToRender = state . MUITypes ;
50
+
49
51
return (
50
52
< div className = { 'HTMLItems' } >
51
53
< div id = "HTMLItemsTopHalf" >
@@ -93,7 +95,7 @@ const DragDropPanel = (props): JSX.Element => {
93
95
</ Grid >
94
96
</ AccordionDetails >
95
97
</ Accordion >
96
-
98
+
97
99
{ /* MUI Components */ }
98
100
< Accordion className = { classes . accordion } >
99
101
< AccordionSummary
@@ -106,23 +108,23 @@ const DragDropPanel = (props): JSX.Element => {
106
108
</ AccordionSummary >
107
109
< AccordionDetails >
108
110
< Grid container justifyContent = "center" >
109
- { htmlTypesToRender . map ( ( option ) => {
110
- if ( option . name === 'MUI' ) {
111
- return (
112
- < HTMLItem
113
- name = { option . name }
114
- key = { `html -${ option . name } ` }
115
- id = { option . id }
116
- icon = { option . icon }
117
- handleDelete = { handleDelete }
118
- />
119
- ) ;
120
- }
111
+ { muiTypesToRender . map ( ( option ) => {
112
+ // if (option.name === 'MUI') {
113
+ return (
114
+ < HTMLItem
115
+ name = { option . name }
116
+ key = { `mui -${ option . name } ` }
117
+ id = { option . id }
118
+ icon = { option . icon }
119
+ handleDelete = { handleDelete }
120
+ />
121
+ ) ;
122
+ // }
121
123
} ) }
122
124
</ Grid >
123
125
</ AccordionDetails >
124
126
</ Accordion >
125
-
127
+
126
128
{ /* React Router */ }
127
129
< Accordion className = { classes . accordion } >
128
130
< AccordionSummary
@@ -156,7 +158,7 @@ const DragDropPanel = (props): JSX.Element => {
156
158
</ Grid >
157
159
</ AccordionDetails >
158
160
</ Accordion >
159
-
161
+
160
162
{ /* Next.js */ }
161
163
{ state . projectType === 'Next.js' ? (
162
164
< h3 style = { { color : 'C6C6C6' } } > Next.js</ h3 >
@@ -183,4 +185,3 @@ const DragDropPanel = (props): JSX.Element => {
183
185
} ;
184
186
185
187
export default DragDropPanel ;
186
-
0 commit comments