Skip to content

Commit 933d7d5

Browse files
Bianca PicassoBianca Picasso
Bianca Picasso
authored and
Bianca Picasso
committed
component boxes
Co-authored-by: Huy Pham [email protected] Co-authored-by: Sal Saluga [email protected] Co-authored-by: Ken Bains [email protected]
1 parent d460368 commit 933d7d5

File tree

7 files changed

+73
-28
lines changed

7 files changed

+73
-28
lines changed

app/src/components/bottom/BottomTabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import CodePreview from './CodePreview';
77
import StylesEditor from './StylesEditor';
88
import CustomizationPanel from '../../containers/CustomizationPanel'
99
import CreationPanel from './CreationPanel'
10-
import ContextManager from './ContexManager'
10+
import ContextManager from './ContextManager'
1111
import Box from '@material-ui/core/Box';
1212
import Tree from '../../tree/TreeChart';
1313
import FormControl from '@material-ui/core/FormControl';

app/src/components/bottom/ContexManager.tsx

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import ContextAssigner from 'app/src/components/right/ContextAssigner.tsx';
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React, { useContext } from 'react';
2+
import ComponentPanel from '../right/ComponentPanel';
3+
import ContextAssigner from '../right/ContextAssigner';
4+
import ContextMenu from '../right/ContextMenu';
5+
import ContextTree from '../right/ContextTree';
6+
import HTMLPanel from '../left/HTMLPanel';
7+
import { styleContext } from '../../containers/AppContainer';
8+
import CssBaseline from '@mui/material/CssBaseline';
9+
import Box from '@mui/material/Box';
10+
import Container from '@mui/material/Container';
11+
import { styled } from '@mui/material/styles';
12+
13+
14+
15+
const ContextManager= (props): JSX.Element => {
16+
// const {style} = useContext(styleContext);
17+
return (
18+
<React.Fragment>
19+
{/* <CssBaseline /> */}
20+
<Container style={{"backgroundColor": "white", "height" : "100%", "width": "100%"}} >
21+
<Box display="grid" gridTemplateColumns="repeat(12, 1fr)" gap={0}>
22+
<Box gridColumn="span 4" style={{"border": "1px solid black", "height": "100%"}}>
23+
<Box style={{"height" : "50em", "border": "1px solid black"}}>
24+
<ContextMenu />
25+
</Box>
26+
<Box style={{"height" : "50em", "border": "1px solid black"}}>
27+
<ContextAssigner/>
28+
</Box>
29+
</Box>
30+
<Box gridColumn="span 8" style={{"border": "1px solid black"}}>
31+
<ContextTree/>
32+
</Box>
33+
</Box>
34+
</Container>
35+
</React.Fragment>
36+
37+
);
38+
};
39+
40+
export default ContextManager;

app/src/components/right/ComponentDropDown.tsx renamed to app/src/components/right/ContextAssigner.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import FormControl from '@mui/material/FormControl';
66
import Select, { SelectChangeEvent } from '@mui/material/Select';
77
import StateContext from '../../context/context';
88

9-
export default function ComponentDropDown() {
9+
export default function ContextAssigner() {
1010
const [age, setAge] = React.useState('');
1111
const [componentList, dispatch] = React.useContext(StateContext);
1212

@@ -16,22 +16,22 @@ export default function ComponentDropDown() {
1616
};
1717

1818
return (
19-
<Box sx={{ minWidth: 120 }}>
19+
20+
<Box sx={{ minWidth:100 }}>
2021
<FormControl fullWidth>
21-
<InputLabel id="demo-simple-select-label">Age</InputLabel>
22+
<InputLabel id="demo-simple-select-label">Select Component</InputLabel>
2223
<Select
2324
labelId="demo-simple-select-label"
2425
id="demo-simple-select"
2526
value={age}
2627
label="Age"
2728
onChange={handleChange}
2829
>
29-
<MenuItem value={10}>Ten</MenuItem>
30-
<MenuItem value={20}>Twenty</MenuItem>
31-
<MenuItem value={30}>Thirty</MenuItem>
30+
{componentList.components.map((component) => {
31+
return <MenuItem value={component.name}>{component.name}</MenuItem>
32+
})}
3233
</Select>
3334
</FormControl>
3435
</Box>
3536
);
36-
}
37-
37+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* imput component
2+
input component
3+
button component
4+
*/
5+
import React from 'react';
6+
7+
8+
const ContextMenu = () => {
9+
return (
10+
<h1>This is from context menu</h1>
11+
)
12+
}
13+
14+
export default ContextMenu;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
3+
const ContextTree = () => {
4+
return (
5+
<h1>Our beautiful tree is here</h1>
6+
)
7+
}
8+
9+
export default ContextTree;

0 commit comments

Comments
 (0)