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