File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 11import React , { Component } from 'react' ;
2+ import PropTypes from 'prop-types' ;
23import plotly from 'plotly.js/dist/plotly' ;
34import PlotlyEditor from 'react-chart-editor' ;
45import CustomEditor from './CustomEditor' ;
6+ import { localizeString } from 'react-chart-editor/lib' ;
57import 'react-chart-editor/lib/react-chart-editor.css' ;
68
79const dataSources = {
@@ -33,6 +35,12 @@ class App extends Component {
3335 } ;
3436 }
3537
38+ getChildContext ( ) {
39+ return {
40+ localize : key => localizeString ( { } , 'en' , key ) ,
41+ } ;
42+ }
43+
3644 render ( ) {
3745 return (
3846 < div className = "app" >
@@ -58,4 +66,8 @@ class App extends Component {
5866 }
5967}
6068
69+ App . childContextTypes = {
70+ localize : PropTypes . func ,
71+ } ;
72+
6173export default App ;
Original file line number Diff line number Diff line change @@ -84,6 +84,10 @@ UnconnectedTextEditor.propTypes = {
8484 updatePlot : PropTypes . func ,
8585} ;
8686
87+ UnconnectedTextEditor . contextTypes = {
88+ localize : PropTypes . func ,
89+ } ;
90+
8791export default connectToContainer ( UnconnectedTextEditor , {
8892 modifyPlotProps : ( props , context , plotProps ) => {
8993 if ( plotProps . isVisible && plotProps . multiValued ) {
You can’t perform that action at this time.
0 commit comments