Skip to content

Commit d460368

Browse files
Bianca PicassoBianca Picasso
Bianca Picasso
authored and
Bianca Picasso
committed
context manager tab
Co-authored-by: Huy Pham [email protected] Co-authored-by: Sal Saluga [email protected] Co-authored-by: Ken Bains [email protected]
1 parent 3f0276a commit d460368

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed

app/src/components/bottom/BottomTabs.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +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'
1011
import Box from '@material-ui/core/Box';
1112
import Tree from '../../tree/TreeChart';
1213
import FormControl from '@material-ui/core/FormControl';
@@ -78,6 +79,11 @@ const BottomTabs = (props): JSX.Element => {
7879
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
7980
label="Component Tree"
8081
/>
82+
<Tab
83+
disableRipple
84+
classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
85+
label="Context Manager"
86+
/>
8187
</Tabs>
8288
<div className={classes.projectTypeWrapper}>
8389
<FormControl size='small'>
@@ -101,6 +107,7 @@ const BottomTabs = (props): JSX.Element => {
101107
{tab === 2 && <StylesEditor theme={theme} setTheme={setTheme} />}
102108
{tab === 3 && <CodePreview theme={theme} setTheme={setTheme} />}
103109
{tab === 4 && <Tree data={components} />}
110+
{tab === 5 && <ContextManager theme={theme} setTheme={setTheme} />}
104111
</div>
105112
);
106113
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React, { useContext } from 'react';
2+
import ComponentPanel from '../right/ComponentPanel'
3+
import ComponentDropDown from '../right/ComponentDropDown'
4+
import HTMLPanel from '../left/HTMLPanel'
5+
import { styleContext } from '../../containers/AppContainer';
6+
7+
8+
const ContextManager= (props): JSX.Element => {
9+
const {style} = useContext(styleContext);
10+
return (
11+
<div className="creation-panel" style={style}>
12+
{/* <HTMLPanel isThemeLight={props.isThemeLight}/> */}
13+
{/* <ComponentDropDown isThemeLight={props.isThemeLight}/> */}
14+
<ComponentDropDown/>
15+
</div>
16+
);
17+
};
18+
19+
export default ContextManager;

app/src/components/bottom/CreationPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const CreationPanel = (props): JSX.Element => {
1010
const {style} = useContext(styleContext);
1111
return (
1212
<div className="creation-panel" style={style}>
13+
1314
<ComponentPanel isThemeLight={props.isThemeLight}/>
1415
<HTMLPanel isThemeLight={props.isThemeLight}/>
1516
<StatePropsPanel isThemeLight={props.isThemeLight}/>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import * as React from 'react';
2+
import Box from '@mui/material/Box';
3+
import InputLabel from '@mui/material/InputLabel';
4+
import MenuItem from '@mui/material/MenuItem';
5+
import FormControl from '@mui/material/FormControl';
6+
import Select, { SelectChangeEvent } from '@mui/material/Select';
7+
import StateContext from '../../context/context';
8+
9+
export default function ComponentDropDown() {
10+
const [age, setAge] = React.useState('');
11+
const [componentList, dispatch] = React.useContext(StateContext);
12+
13+
console.log(componentList);
14+
const handleChange = (event: SelectChangeEvent) => {
15+
setAge(event.target.value as string);
16+
};
17+
18+
return (
19+
<Box sx={{ minWidth: 120 }}>
20+
<FormControl fullWidth>
21+
<InputLabel id="demo-simple-select-label">Age</InputLabel>
22+
<Select
23+
labelId="demo-simple-select-label"
24+
id="demo-simple-select"
25+
value={age}
26+
label="Age"
27+
onChange={handleChange}
28+
>
29+
<MenuItem value={10}>Ten</MenuItem>
30+
<MenuItem value={20}>Twenty</MenuItem>
31+
<MenuItem value={30}>Thirty</MenuItem>
32+
</Select>
33+
</FormControl>
34+
</Box>
35+
);
36+
}
37+

0 commit comments

Comments
 (0)