1- import React , { Fragment } from 'react' ;
1+ import React , { Component } from 'react' ;
22import PropTypes from 'prop-types' ;
33import { PanelMenuWrapper } from './components' ;
4- import { localize } from './lib' ;
54import {
65 GraphCreatePanel ,
76 StyleLayoutPanel ,
@@ -16,28 +15,34 @@ import {
1615 StyleUpdateMenusPanel ,
1716} from './default_panels' ;
1817
19- const DefaultEditor = ( { children, localize : _ } ) => (
20- < Fragment >
21- < PanelMenuWrapper >
22- < GraphCreatePanel group = { _ ( 'Graph' ) } name = { _ ( 'Create' ) } />
23- < StyleTracesPanel group = { _ ( 'Style' ) } name = { _ ( 'Traces' ) } />
24- < StyleLayoutPanel group = { _ ( 'Style' ) } name = { _ ( 'Layout' ) } />
25- < StyleNotesPanel group = { _ ( 'Style' ) } name = { _ ( 'Notes' ) } />
26- < StyleAxesPanel group = { _ ( 'Style' ) } name = { _ ( 'Axes' ) } />
27- < StyleLegendPanel group = { _ ( 'Style' ) } name = { _ ( 'Legend' ) } />
28- < StyleColorbarsPanel group = { _ ( 'Style' ) } name = { _ ( 'Color Bars' ) } />
29- < StyleShapesPanel group = { _ ( 'Style' ) } name = { _ ( 'Shapes' ) } />
30- < StyleImagesPanel group = { _ ( 'Style' ) } name = { _ ( 'Images' ) } />
31- < StyleSlidersPanel group = { _ ( 'Style' ) } name = { _ ( 'Sliders' ) } />
32- < StyleUpdateMenusPanel group = { _ ( 'Style' ) } name = { _ ( 'Menus' ) } />
33- { children ? children : null }
34- </ PanelMenuWrapper >
35- </ Fragment >
36- ) ;
18+ class DefaultEditor extends Component {
19+ render ( ) {
20+ const _ = this . context . localize ;
21+ return (
22+ < PanelMenuWrapper >
23+ < GraphCreatePanel group = { _ ( 'Graph' ) } name = { _ ( 'Create' ) } />
24+ < StyleTracesPanel group = { _ ( 'Style' ) } name = { _ ( 'Traces' ) } />
25+ < StyleLayoutPanel group = { _ ( 'Style' ) } name = { _ ( 'Layout' ) } />
26+ < StyleNotesPanel group = { _ ( 'Style' ) } name = { _ ( 'Notes' ) } />
27+ < StyleAxesPanel group = { _ ( 'Style' ) } name = { _ ( 'Axes' ) } />
28+ < StyleLegendPanel group = { _ ( 'Style' ) } name = { _ ( 'Legend' ) } />
29+ < StyleColorbarsPanel group = { _ ( 'Style' ) } name = { _ ( 'Color Bars' ) } />
30+ < StyleShapesPanel group = { _ ( 'Style' ) } name = { _ ( 'Shapes' ) } />
31+ < StyleImagesPanel group = { _ ( 'Style' ) } name = { _ ( 'Images' ) } />
32+ < StyleSlidersPanel group = { _ ( 'Style' ) } name = { _ ( 'Sliders' ) } />
33+ < StyleUpdateMenusPanel group = { _ ( 'Style' ) } name = { _ ( 'Menus' ) } />
34+ { this . props . children ? this . props . children : null }
35+ </ PanelMenuWrapper >
36+ ) ;
37+ }
38+ }
3739
3840DefaultEditor . propTypes = {
39- localize : PropTypes . func ,
4041 children : PropTypes . node ,
4142} ;
4243
43- export default localize ( DefaultEditor ) ;
44+ DefaultEditor . contextTypes = {
45+ localize : PropTypes . func ,
46+ } ;
47+
48+ export default DefaultEditor ;
0 commit comments