File tree Expand file tree Collapse file tree 5 files changed +21
-13
lines changed Expand file tree Collapse file tree 5 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -9,22 +9,24 @@ import Tree from '../../tree/TreeChart';
9
9
import { emitKeypressEvents } from 'readline' ;
10
10
import NativeSelect from '@material-ui/core/NativeSelect' ;
11
11
import FormControl from '@material-ui/core/FormControl' ;
12
+ import { styleContext } from '../../containers/AppContainer' ;
12
13
13
- const BottomTabs = ( { style } ) => {
14
+
15
+ const BottomTabs = ( ) => {
14
16
// state that controls which tab the user is on
15
17
const [ state , dispatch ] = useContext ( StateContext ) ;
16
18
const [ tab , setTab ] = useState ( 0 ) ;
17
19
const classes = useStyles ( ) ;
18
20
treeWrapper: HTMLDivElement ;
19
21
const [ theme , setTheme ] = useState ( 'monokai' ) ;
22
+ const { style } = useContext ( styleContext ) ;
20
23
21
24
// method changes the
22
25
const handleChange = ( event : React . ChangeEvent , value : number ) => {
23
26
setTab ( value ) ;
24
27
} ;
25
28
26
- const { HTMLTypes } = state ;
27
- const { components } = state ;
29
+ const { components, HTMLTypes } = state ;
28
30
29
31
const changeTheme = e => {
30
32
setTheme ( e . target . value ) ;
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
-
1
+ import React , { useContext } from 'react' ;
3
2
import Grid from '@material-ui/core/Grid' ;
4
-
5
3
import ComponentPanel from '../components/left/ComponentPanel' ;
6
4
import HTMLPanel from '../components/left/HTMLPanel' ;
5
+ import { styleContext } from './AppContainer' ;
7
6
8
7
// Left-hand portion of the app, where component options are displayed
9
- const LeftContainer = ( { style } ) : JSX . Element => {
8
+ const LeftContainer = ( ) : JSX . Element => {
9
+ const { style } = useContext ( styleContext ) ;
10
+
10
11
return (
11
12
< div className = "column left" style = { style } >
12
13
< Grid container direction = "row" alignItems = "center" >
Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import React , { useContext } from 'react' ;
2
2
import BottomPanel from '../components/bottom/BottomPanel' ;
3
3
import CanvasContainer from '../components/main/CanvasContainer' ;
4
+ import { styleContext } from './AppContainer' ;
5
+
6
+ const MainContainer = ( ) => {
7
+ const { style } = useContext ( styleContext ) ;
4
8
5
- const MainContainer = ( { style } ) => {
6
9
return (
7
- < div className = "main-container" style = { style } >
10
+ < div className = "main-container" style = { style } >
8
11
< div className = "main" >
9
12
< CanvasContainer />
10
13
</ div >
11
- < BottomPanel style = { style } />
14
+ < BottomPanel />
12
15
</ div >
13
16
) ;
14
17
} ;
Original file line number Diff line number Diff line change @@ -19,9 +19,10 @@ import DialogContent from '@material-ui/core/DialogContent';
19
19
import DialogContentText from '@material-ui/core/DialogContentText' ;
20
20
import DialogTitle from '@material-ui/core/DialogTitle' ;
21
21
import ErrorMessages from '../constants/ErrorMessages' ;
22
+ import { styleContext } from './AppContainer' ;
22
23
23
24
// need to pass in props to use the useHistory feature of react router
24
- const RightContainer = ( { style } ) : JSX . Element => {
25
+ const RightContainer = ( ) : JSX . Element => {
25
26
const classes = useStyles ( ) ;
26
27
const [ state , dispatch ] = useContext ( StateContext ) ;
27
28
const [ displayMode , setDisplayMode ] = useState ( '' ) ;
@@ -34,6 +35,7 @@ const RightContainer = ({ style }): JSX.Element => {
34
35
const [ deleteLinkedPageError , setDeleteLinkedPageError ] = useState ( false ) ;
35
36
const [ deleteIndexError , setDeleteIndexError ] = useState ( false ) ;
36
37
const [ deleteComponentError , setDeleteComponentError ] = useState ( false ) ;
38
+ const { style } = useContext ( styleContext ) ;
37
39
38
40
const resetFields = ( ) => {
39
41
const style = configTarget . child
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ function usePrevious(value) {
11
11
return ref . current ;
12
12
}
13
13
14
- function TreeChart ( { theme , setTheme , data } ) {
14
+ function TreeChart ( { data } ) {
15
15
const [ state , dispatch ] = useContext ( StateContext ) ;
16
16
const canvasId = state . canvasFocus . componentId ;
17
17
You can’t perform that action at this time.
0 commit comments