@@ -8,9 +8,8 @@ import TopNavBar from './components/TopNavBar/TopNavBar';
88import Form from './components/Form/Form' ;
99import Tab from './components/Tab/Tab' ;
1010import MessageComp from './components/MessageComp/MessageComp' ;
11- import SettingsBar from './components/SettingsBar/SettingsBar' ;
12- import Dropdown from './components/Dropdown/Dropdown' ;
13- import Version from './components/Version/Version' ;
11+ import TabPanel from './components/Tab/TabPanel/TabPanel' ;
12+ import Main from './components/Main/Main' ;
1413
1514import styles from './styles/App.scss' ;
1615import fade from './styles/transitions/fade.scss' ;
@@ -21,6 +20,7 @@ const mapStateToProps = state => {
2120 showLoadingMessage : state . toggleLoadingMessage ,
2221 showErrorMessage : state . toggleErrorMessage ,
2322 errorMessage : state . toggleErrorMessage ,
23+ currentTabIndex : state . setActiveIndex
2424 }
2525}
2626
@@ -43,6 +43,8 @@ class App extends React.Component {
4343 fetchRequestStatus : undefined ,
4444 contracts : [ ] ,
4545 }
46+
47+ this . handleMenuItemIconClick = this . handleMenuItemIconClick . bind ( this ) ;
4648 }
4749
4850 componentDidMount ( ) {
@@ -124,7 +126,7 @@ class App extends React.Component {
124126 render ( ) {
125127
126128 const { fetchRequestStatus, contracts, versions } = this . state ;
127- const { children , showLoadingMessage, showErrorMessage, errorMessage } = this . props ;
129+ const { showLoadingMessage, showErrorMessage, errorMessage } = this . props ;
128130
129131 return (
130132 < div className = { styles [ 'app' ] } >
@@ -174,8 +176,22 @@ class App extends React.Component {
174176 transitionLeaveTimeout = { 300 }
175177 >
176178 { fetchRequestStatus === 'success' && contracts . length &&
177- < Tab data = { contracts } onMenuItemIconClick = { this . handleMenuItemIconClick } >
178- { children }
179+ < Tab onMenuItemIconClick = { this . handleMenuItemIconClick } >
180+ { contracts . map ( ( item , i ) => {
181+ return (
182+ < TabPanel
183+ key = { `id--${ item . name } --${ i } ` }
184+ name = { item . name }
185+ >
186+ < Main
187+ name = { item . name }
188+ code = { item . code }
189+ path = { item . path }
190+ index = { i }
191+ />
192+ </ TabPanel >
193+ )
194+ } ) }
179195 </ Tab >
180196 }
181197 </ CSSTransitionGroup >
0 commit comments