github.com/anthdm/go-ethereum@v1.8.4-0.20180412101906-60516c83b011/dashboard/assets/components/Body.jsx (about) 1 // @flow 2 3 // Copyright 2017 The go-ethereum Authors 4 // This file is part of the go-ethereum library. 5 // 6 // The go-ethereum library is free software: you can redistribute it and/or modify 7 // it under the terms of the GNU Lesser General Public License as published by 8 // the Free Software Foundation, either version 3 of the License, or 9 // (at your option) any later version. 10 // 11 // The go-ethereum library is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU Lesser General Public License for more details. 15 // 16 // You should have received a copy of the GNU Lesser General Public License 17 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 18 19 import React, {Component} from 'react'; 20 21 import SideBar from './SideBar'; 22 import Main from './Main'; 23 import type {Content} from '../types/content'; 24 25 // styles contains the constant styles of the component. 26 const styles = { 27 body: { 28 display: 'flex', 29 width: '100%', 30 height: '100%', 31 }, 32 }; 33 34 export type Props = { 35 opened: boolean, 36 changeContent: string => void, 37 active: string, 38 content: Content, 39 shouldUpdate: Object, 40 }; 41 42 // Body renders the body of the dashboard. 43 class Body extends Component<Props> { 44 render() { 45 return ( 46 <div style={styles.body}> 47 <SideBar 48 opened={this.props.opened} 49 changeContent={this.props.changeContent} 50 /> 51 <Main 52 active={this.props.active} 53 content={this.props.content} 54 shouldUpdate={this.props.shouldUpdate} 55 /> 56 </div> 57 ); 58 } 59 } 60 61 export default Body;