Skip to content

Commit c716600

Browse files
committed
performed some UI changes in toolbox states positioning
1 parent f1bac81 commit c716600

File tree

1 file changed

+59
-48
lines changed

1 file changed

+59
-48
lines changed

src/features/Playground.tsx

Lines changed: 59 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -92,66 +92,77 @@ const Playground = (props: PlaygroundProps) => {
9292
{/* <div className="toolboxTitle">Drag & drop me!</div> */}
9393
<hr />
9494
<div className="toolboxContainer">
95-
<Box
96-
className="state"
97-
draggable
98-
style={{
99-
width: `${dataContext?.stateSize}px`,
100-
height: `${dataContext?.stateSize}px`,
101-
borderRadius: `${dataContext?.stateSize}px`,
102-
touchAction: "none",
103-
}}
104-
// enable touch events for mobile devices
105-
onTouchMove={props.handleDropDynamic}
106-
>
107-
state
108-
</Box>
109-
11095
<Grid
11196
container
11297
direction="column"
113-
justifyContent="center"
98+
justifyContent="space-between"
11499
alignItems="center"
115-
spacing={1}
100+
sx={{ height: "100%" }}
116101
>
117102
<Grid item>
118103
<Box
119104
className="state"
120-
sx={{
121-
width: `${ToolboxStateSize}px`,
122-
height: `${ToolboxStateSize}px`,
123-
borderRadius: `${ToolboxStateSize}px`,
124-
backgroundColor: stateInitialColor,
125-
}}
126-
>
127-
Initial
128-
</Box>
129-
</Grid>
130-
<Grid item>
131-
<Box
132-
className="state"
133-
sx={{
134-
width: `${ToolboxStateSize}px`,
135-
height: `${ToolboxStateSize}px`,
136-
borderRadius: `${ToolboxStateSize}px`,
137-
backgroundColor: stateFinalColor,
105+
draggable
106+
style={{
107+
width: `${dataContext?.stateSize}px`,
108+
height: `${dataContext?.stateSize}px`,
109+
borderRadius: `${dataContext?.stateSize}px`,
110+
touchAction: "none",
138111
}}
112+
// enable touch events for mobile devices
113+
onTouchMove={props.handleDropDynamic}
139114
>
140-
Final
115+
state
141116
</Box>
142117
</Grid>
143-
<Grid item>
144-
<Box
145-
className="state"
146-
sx={{
147-
width: `${ToolboxStateSize}px`,
148-
height: `${ToolboxStateSize}px`,
149-
borderRadius: `${ToolboxStateSize}px`,
150-
backgroundColor: stateInitialFinalColor,
151-
}}
152-
>
153-
Initial Final
154-
</Box>
118+
119+
<Grid
120+
container
121+
item
122+
direction="column"
123+
justifyContent="center"
124+
alignItems="center"
125+
spacing={1}
126+
>
127+
<Grid item>
128+
<Box
129+
className="state"
130+
sx={{
131+
width: `${ToolboxStateSize}px`,
132+
height: `${ToolboxStateSize}px`,
133+
borderRadius: `${ToolboxStateSize}px`,
134+
backgroundColor: stateInitialColor,
135+
}}
136+
>
137+
Initial
138+
</Box>
139+
</Grid>
140+
<Grid item>
141+
<Box
142+
className="state"
143+
sx={{
144+
width: `${ToolboxStateSize}px`,
145+
height: `${ToolboxStateSize}px`,
146+
borderRadius: `${ToolboxStateSize}px`,
147+
backgroundColor: stateFinalColor,
148+
}}
149+
>
150+
Final
151+
</Box>
152+
</Grid>
153+
<Grid item>
154+
<Box
155+
className="state"
156+
sx={{
157+
width: `${ToolboxStateSize}px`,
158+
height: `${ToolboxStateSize}px`,
159+
borderRadius: `${ToolboxStateSize}px`,
160+
backgroundColor: stateInitialFinalColor,
161+
}}
162+
>
163+
Initial Final
164+
</Box>
165+
</Grid>
155166
</Grid>
156167
</Grid>
157168
</div>

0 commit comments

Comments
 (0)