1
1
// import { BreakfastDiningOutlined } from '@mui/icons-material';
2
2
import React , { useState , useEffect , useRef } from 'react' ;
3
3
import { useDispatch , useSelector } from 'react-redux' ;
4
+ import TextField from '@mui/material/TextField' ;
5
+ import Button from '@mui/material/Button' ;
4
6
/* eslint-disable */
5
7
const CONTEXT_MENU_WIDTH = 225 ;
6
8
const CONTEXT_MENU_HEIGHT = 380 ;
@@ -30,6 +32,7 @@ function ContextMenu({
30
32
31
33
//@ts -ignore
32
34
const appState = useSelector ( ( store : RootState ) => store . appState ) ;
35
+ const buttonText = useSelector ( ( store : RootState ) => store . appState ) ;
33
36
//@ts -ignore
34
37
const contextParam = useSelector ( ( store : RootState ) => store . contextSlice ) ; // this is literally just passed in on everything else, i have no idea what it does, you can look it up, but other files are literally just taking it and passing it back in.
35
38
@@ -152,42 +155,38 @@ function ContextMenu({
152
155
153
156
< div
154
157
style = { {
155
- backgroundColor : targetColor ,
158
+ backgroundColor : '#3b3b3b' ,
159
+ borderRadius : '8px' ,
160
+ border : '2px solid #1f1f1f' ,
161
+ display : 'flex' ,
156
162
zIndex : '100080' ,
157
163
margin : '0px' ,
158
- padding : `${ CONTEXT_MENU_PADDING } px ` ,
164
+ padding : `15px ` ,
159
165
position : 'fixed' ,
160
166
left : `${ xOff } px` ,
161
- top : `${ yOff } px` ,
162
- width : `${ CONTEXT_MENU_WIDTH } px` ,
163
- height : `${ CONTEXT_MENU_HEIGHT } px`
167
+ top : `${ yOff } px`
164
168
} }
165
169
ref = { PanRef }
166
170
>
167
171
{ menuTypeState === 'CanvasElement' && (
168
172
< div >
169
- { false && (
170
- < div
171
- style = { {
172
- backgroundColor : 'green' ,
173
- width : '500px' ,
174
- height : '500px' ,
175
- zIndex : '99999999999999999'
176
- } }
177
- >
178
- ANNOYING POPUP!!!!!
179
- </ div >
180
- ) }
173
+ < Button
174
+ component = "label"
175
+ aria-label = "customize an element"
176
+ key = "customize"
177
+ >
178
+ Customize Element
179
+ </ Button >
181
180
{ openMenu !== 'editClassname' && (
182
- < button
181
+ < div
182
+ className = "popUpButtons"
183
183
onClick = { ( ) => {
184
184
handleStandardFieldButtonClick (
185
185
'editClassname' ,
186
186
'attributes' ,
187
187
'cssclasses'
188
188
) ;
189
189
} }
190
- style = { { padding : '0px' , margin : '0px' , width : '100%' } }
191
190
onMouseOver = { ( ) => {
192
191
console . log ( 'open' ) ;
193
192
setAnnoyingPopupOpen ( true ) ;
@@ -197,14 +196,18 @@ function ContextMenu({
197
196
setAnnoyingPopupOpen ( false ) ;
198
197
} }
199
198
>
200
- edit class list
201
- </ button >
199
+ Add classes
200
+ </ div >
202
201
) }
203
202
{ openMenu === 'editClassname' && (
204
- < input
205
- type = "text"
206
- autoFocus
203
+ < TextField
204
+ id = "outlined-basic"
205
+ label = "Add Classes"
206
+ variant = "outlined"
207
+ size = "small"
207
208
value = { singleMenuValue }
209
+ autoComplete = "off"
210
+ sx = { { width : '156px' , display : 'block' , marginLeft : '8px' } }
208
211
onChange = { ( event ) => {
209
212
singleMenuValueChange (
210
213
event ,
@@ -213,38 +216,36 @@ function ContextMenu({
213
216
'cssclasses'
214
217
) ;
215
218
} }
216
- style = { {
217
- border : 'none' ,
218
- padding : '0px' ,
219
- margin : '0px' ,
220
- marginTop : '1px' ,
221
- width : `${ CONTEXT_MENU_WIDTH - CONTEXT_MENU_PADDING * 2 } px` ,
222
- height : ELEMENT_HEIGHT_SIZE ,
223
- backgroundColor : `rgba(0, 0, 0, 0)` ,
224
- overflow : 'hidden'
225
- } }
226
- > </ input >
219
+ />
227
220
) }
228
- < hr style = { { fontSize : '8px' } } />
221
+
229
222
{ openMenu !== 'editText' && (
230
- < button
223
+ < div
224
+ className = "popUpButtons"
231
225
onClick = { ( ) => {
232
226
handleStandardFieldButtonClick (
233
227
'editText' ,
234
228
'attributes' ,
235
229
'comptext'
236
230
) ;
237
231
} }
238
- style = { { padding : '0px' , margin : '0px' , width : '100%' } }
239
232
>
240
- edit text
241
- </ button >
233
+ Edit inner text
234
+ </ div >
242
235
) }
243
236
{ openMenu === 'editText' && (
244
- < input
245
- type = "text"
246
- autoFocus
237
+ < TextField
238
+ id = "outlined-basic"
239
+ label = "Edit Inner Text"
240
+ variant = "outlined"
247
241
value = { singleMenuValue }
242
+ autoComplete = "off"
243
+ size = "small"
244
+ sx = { {
245
+ width : '156px' ,
246
+ display : 'block' ,
247
+ marginLeft : '8px'
248
+ } }
248
249
onChange = { ( event ) => {
249
250
singleMenuValueChange (
250
251
event ,
@@ -253,37 +254,31 @@ function ContextMenu({
253
254
'comptext'
254
255
) ;
255
256
} }
256
- style = { {
257
- border : 'none' ,
258
- padding : '0px' ,
259
- margin : '0px' ,
260
- marginTop : '1px' ,
261
- width : `${ CONTEXT_MENU_WIDTH - CONTEXT_MENU_PADDING * 2 } px` ,
262
- height : ELEMENT_HEIGHT_SIZE ,
263
- backgroundColor : `rgba(0, 0, 0, 0)` ,
264
- overflow : 'hidden'
265
- } }
266
- > </ input >
257
+ />
267
258
) }
268
259
{ openMenu !== 'editLink' && (
269
- < button
260
+ < div
261
+ className = "popUpButtons"
270
262
onClick = { ( ) => {
271
263
handleStandardFieldButtonClick (
272
264
'editLink' ,
273
265
'attributes' ,
274
266
'complink'
275
267
) ;
276
268
} }
277
- style = { { padding : '0px' , margin : '0px' , width : '100%' } }
278
269
>
279
- edit link (?)
280
- </ button >
270
+ Add a link
271
+ </ div >
281
272
) }
282
273
{ openMenu === 'editLink' && (
283
- < input
284
- type = "text"
285
- autoFocus
274
+ < TextField
275
+ id = "outlined-basic"
276
+ label = "Edit Link"
277
+ variant = "outlined"
278
+ size = "small"
286
279
value = { singleMenuValue }
280
+ autoComplete = "off"
281
+ sx = { { width : '156px' , display : 'block' , marginLeft : '8px' } }
287
282
onChange = { ( event ) => {
288
283
singleMenuValueChange (
289
284
event ,
@@ -292,38 +287,32 @@ function ContextMenu({
292
287
'complink'
293
288
) ;
294
289
} }
295
- style = { {
296
- border : 'none' ,
297
- padding : '0px' ,
298
- margin : '0px' ,
299
- marginTop : '1px' ,
300
- width : `${ CONTEXT_MENU_WIDTH - CONTEXT_MENU_PADDING * 2 } px` ,
301
- height : ELEMENT_HEIGHT_SIZE ,
302
- backgroundColor : `rgba(0, 0, 0, 0)` ,
303
- overflow : 'hidden'
304
- } }
305
- > </ input >
290
+ />
306
291
) }
307
- < hr style = { { fontSize : '8px' } } />
292
+
308
293
{ openMenu !== 'editBackgroundColor' && (
309
- < button
294
+ < div
295
+ className = "popUpButtons"
310
296
onClick = { ( ) => {
311
297
handleStandardFieldButtonClick (
312
298
'editBackgroundColor' ,
313
299
'style' ,
314
300
'backgroundColor'
315
301
) ;
316
302
} }
317
- style = { { padding : '0px' , margin : '0px' , width : '100%' } }
318
303
>
319
- set background color
320
- </ button >
304
+ Set background color
305
+ </ div >
321
306
) }
322
307
{ openMenu === 'editBackgroundColor' && (
323
- < input
324
- type = "text"
325
- autoFocus
308
+ < TextField
309
+ id = "outlined-basic"
310
+ label = "Set Background Color"
311
+ variant = "outlined"
312
+ size = "small"
326
313
value = { singleMenuValue }
314
+ autoComplete = "off"
315
+ sx = { { width : '156px' , display : 'block' , marginLeft : '8px' } }
327
316
onChange = { ( event ) => {
328
317
singleMenuValueChange (
329
318
event ,
@@ -332,17 +321,7 @@ function ContextMenu({
332
321
'backgroundColor'
333
322
) ;
334
323
} }
335
- style = { {
336
- border : 'none' ,
337
- padding : '0px' ,
338
- margin : '0px' ,
339
- marginTop : '1px' ,
340
- width : `${ CONTEXT_MENU_WIDTH - CONTEXT_MENU_PADDING * 2 } px` ,
341
- height : ELEMENT_HEIGHT_SIZE ,
342
- backgroundColor : `rgba(0, 0, 0, 0)` ,
343
- overflow : 'hidden'
344
- } }
345
- > </ input >
324
+ />
346
325
) }
347
326
</ div >
348
327
) }
0 commit comments