Skip to content

Commit be1a4a5

Browse files
committed
added more explainer popovers to HTML+MUI, other modules, and add router headers.
1 parent 87af137 commit be1a4a5

File tree

6 files changed

+445
-99
lines changed

6 files changed

+445
-99
lines changed

app/src/components/ContextMenu.tsx

Lines changed: 70 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// import { BreakfastDiningOutlined } from '@mui/icons-material';
22
import React, { useState, useEffect, useRef } from 'react';
33
import { useDispatch, useSelector } from 'react-redux';
4+
import TextField from '@mui/material/TextField';
5+
import Button from '@mui/material/Button';
46
/* eslint-disable */
57
const CONTEXT_MENU_WIDTH = 225;
68
const CONTEXT_MENU_HEIGHT = 380;
@@ -30,6 +32,7 @@ function ContextMenu({
3032

3133
//@ts-ignore
3234
const appState = useSelector((store: RootState) => store.appState);
35+
const buttonText = useSelector((store: RootState) => store.appState);
3336
//@ts-ignore
3437
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.
3538

@@ -152,42 +155,38 @@ function ContextMenu({
152155

153156
<div
154157
style={{
155-
backgroundColor: targetColor,
158+
backgroundColor: '#3b3b3b',
159+
borderRadius: '8px',
160+
border: '2px solid #1f1f1f',
161+
display: 'flex',
156162
zIndex: '100080',
157163
margin: '0px',
158-
padding: `${CONTEXT_MENU_PADDING}px`,
164+
padding: `15px`,
159165
position: 'fixed',
160166
left: `${xOff}px`,
161-
top: `${yOff}px`,
162-
width: `${CONTEXT_MENU_WIDTH}px`,
163-
height: `${CONTEXT_MENU_HEIGHT}px`
167+
top: `${yOff}px`
164168
}}
165169
ref={PanRef}
166170
>
167171
{menuTypeState === 'CanvasElement' && (
168172
<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>
181180
{openMenu !== 'editClassname' && (
182-
<button
181+
<div
182+
className="popUpButtons"
183183
onClick={() => {
184184
handleStandardFieldButtonClick(
185185
'editClassname',
186186
'attributes',
187187
'cssclasses'
188188
);
189189
}}
190-
style={{ padding: '0px', margin: '0px', width: '100%' }}
191190
onMouseOver={() => {
192191
console.log('open');
193192
setAnnoyingPopupOpen(true);
@@ -197,14 +196,18 @@ function ContextMenu({
197196
setAnnoyingPopupOpen(false);
198197
}}
199198
>
200-
edit class list
201-
</button>
199+
Add classes
200+
</div>
202201
)}
203202
{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"
207208
value={singleMenuValue}
209+
autoComplete="off"
210+
sx={{ width: '156px', display: 'block', marginLeft: '8px' }}
208211
onChange={(event) => {
209212
singleMenuValueChange(
210213
event,
@@ -213,38 +216,36 @@ function ContextMenu({
213216
'cssclasses'
214217
);
215218
}}
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+
/>
227220
)}
228-
<hr style={{ fontSize: '8px' }} />
221+
229222
{openMenu !== 'editText' && (
230-
<button
223+
<div
224+
className="popUpButtons"
231225
onClick={() => {
232226
handleStandardFieldButtonClick(
233227
'editText',
234228
'attributes',
235229
'comptext'
236230
);
237231
}}
238-
style={{ padding: '0px', margin: '0px', width: '100%' }}
239232
>
240-
edit text
241-
</button>
233+
Edit inner text
234+
</div>
242235
)}
243236
{openMenu === 'editText' && (
244-
<input
245-
type="text"
246-
autoFocus
237+
<TextField
238+
id="outlined-basic"
239+
label="Edit Inner Text"
240+
variant="outlined"
247241
value={singleMenuValue}
242+
autoComplete="off"
243+
size="small"
244+
sx={{
245+
width: '156px',
246+
display: 'block',
247+
marginLeft: '8px'
248+
}}
248249
onChange={(event) => {
249250
singleMenuValueChange(
250251
event,
@@ -253,37 +254,31 @@ function ContextMenu({
253254
'comptext'
254255
);
255256
}}
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+
/>
267258
)}
268259
{openMenu !== 'editLink' && (
269-
<button
260+
<div
261+
className="popUpButtons"
270262
onClick={() => {
271263
handleStandardFieldButtonClick(
272264
'editLink',
273265
'attributes',
274266
'complink'
275267
);
276268
}}
277-
style={{ padding: '0px', margin: '0px', width: '100%' }}
278269
>
279-
edit link (?)
280-
</button>
270+
Add a link
271+
</div>
281272
)}
282273
{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"
286279
value={singleMenuValue}
280+
autoComplete="off"
281+
sx={{ width: '156px', display: 'block', marginLeft: '8px' }}
287282
onChange={(event) => {
288283
singleMenuValueChange(
289284
event,
@@ -292,38 +287,32 @@ function ContextMenu({
292287
'complink'
293288
);
294289
}}
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+
/>
306291
)}
307-
<hr style={{ fontSize: '8px' }} />
292+
308293
{openMenu !== 'editBackgroundColor' && (
309-
<button
294+
<div
295+
className="popUpButtons"
310296
onClick={() => {
311297
handleStandardFieldButtonClick(
312298
'editBackgroundColor',
313299
'style',
314300
'backgroundColor'
315301
);
316302
}}
317-
style={{ padding: '0px', margin: '0px', width: '100%' }}
318303
>
319-
set background color
320-
</button>
304+
Set background color
305+
</div>
321306
)}
322307
{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"
326313
value={singleMenuValue}
314+
autoComplete="off"
315+
sx={{ width: '156px', display: 'block', marginLeft: '8px' }}
327316
onChange={(event) => {
328317
singleMenuValueChange(
329318
event,
@@ -332,17 +321,7 @@ function ContextMenu({
332321
'backgroundColor'
333322
);
334323
}}
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+
/>
346325
)}
347326
</div>
348327
)}

0 commit comments

Comments
 (0)