File tree Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import CodePreview from './CodePreview';
7
7
import StylesEditor from './StylesEditor' ;
8
8
import CustomizationPanel from '../../containers/CustomizationPanel'
9
9
import CreationPanel from './CreationPanel'
10
+ import ContextManager from './ContexManager'
10
11
import Box from '@material-ui/core/Box' ;
11
12
import Tree from '../../tree/TreeChart' ;
12
13
import FormControl from '@material-ui/core/FormControl' ;
@@ -78,6 +79,11 @@ const BottomTabs = (props): JSX.Element => {
78
79
classes = { { root : classes . tabRoot , selected : classes . tabSelected } }
79
80
label = "Component Tree"
80
81
/>
82
+ < Tab
83
+ disableRipple
84
+ classes = { { root : classes . tabRoot , selected : classes . tabSelected } }
85
+ label = "Context Manager"
86
+ />
81
87
</ Tabs >
82
88
< div className = { classes . projectTypeWrapper } >
83
89
< FormControl size = 'small' >
@@ -101,6 +107,7 @@ const BottomTabs = (props): JSX.Element => {
101
107
{ tab === 2 && < StylesEditor theme = { theme } setTheme = { setTheme } /> }
102
108
{ tab === 3 && < CodePreview theme = { theme } setTheme = { setTheme } /> }
103
109
{ tab === 4 && < Tree data = { components } /> }
110
+ { tab === 5 && < ContextManager theme = { theme } setTheme = { setTheme } /> }
104
111
</ div >
105
112
) ;
106
113
} ;
Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const CreationPanel = (props): JSX.Element => {
10
10
const { style} = useContext ( styleContext ) ;
11
11
return (
12
12
< div className = "creation-panel" style = { style } >
13
+
13
14
< ComponentPanel isThemeLight = { props . isThemeLight } />
14
15
< HTMLPanel isThemeLight = { props . isThemeLight } />
15
16
< StatePropsPanel isThemeLight = { props . isThemeLight } />
Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments