1 import React from 'react'
2 import styles from './Main.scss'
3 import { MenuItem, Dropdown } from 'react-bootstrap'
4 import { Link } from 'react-router'
5 import { connect } from 'react-redux'
6 import actions from 'actions'
7 import Tutorial from 'features/tutorial/components/Tutorial'
8 import TutorialHeader from 'features/tutorial/components/TutorialHeader/TutorialHeader'
9 import { Navigation, SecondaryNavigation } from '../'
10 import { withNamespaces } from 'react-i18next'
12 class Main extends React.Component {
20 this.toggleDropdown = this.toggleDropdown.bind(this)
21 this.setTutorialHeight = this.setTutorialHeight.bind(this)
24 setTutorialHeight(height) {
25 this.setState({tutorialHeight: height })
28 toggleDropdown(event) {
29 event.stopPropagation()
30 this.props.toggleDropdown()
34 let logo = require('images/logo-bytom-white.svg')
36 const { t, i18n , version } = this.props
38 const changeLanguage = (lng) => {
39 i18n.changeLanguage(lng)
43 <div className={styles.main}
44 onClick={this.props.closeDropdown} >
45 <div className={styles.sidebar}>
46 <div className={styles.sidebarContent}>
47 <div className={styles.logo}>
49 <img src={logo} className={styles.brand_image} />
53 id='dropdown-custom-1'
55 className={styles.languagesContainer}
57 onSelect={changeLanguage}
60 className={styles.languages}
66 className={styles.languagesMenu}
68 <MenuItem eventKey='zh'>中文</MenuItem>
69 <MenuItem eventKey='en'>ENGLISH</MenuItem>
74 <span className={styles.settings} onClick={this.toggleDropdown}>
75 <img src={require('images/navigation/settings.png')}/>
77 {this.props.showDropwdown && <SecondaryNavigation/>}
83 <div className={styles.version}>
85 {t('commonWords.version')}: {version}
92 <div className={`${styles.content} flex-container`} style={{marginTop: this.state.tutorialHeight}}>
93 {!this.props.connected && <div className={styles.connectionIssue}>
94 There was an issue connecting to Chain Core. Please check your connection while dashboard attempts to reconnect.
96 <TutorialHeader handleTutorialHeight={this.setTutorialHeight}>
97 <Tutorial types={['TutorialInfo']}/>
106 export default withNamespaces('translations') (connect(
108 canLogOut: state.core.requireClientToken,
109 version:state.core.version,
111 showDropwdown: state.app.dropdownState == 'open',
114 toggleDropdown: () => dispatch(actions.app.toggleDropdown),
115 closeDropdown: () => dispatch(actions.app.closeDropdown),