github.com/arieschain/arieschain@v0.0.0-20191023063405-37c074544356/dashboard/assets/components/Body.jsx (about) 1 // @flow 2 3 4 import React, {Component} from 'react'; 5 6 import SideBar from './SideBar'; 7 import Main from './Main'; 8 import type {Content} from '../types/content'; 9 10 // styles contains the constant styles of the component. 11 const styles = { 12 body: { 13 display: 'flex', 14 width: '100%', 15 height: '100%', 16 }, 17 }; 18 19 export type Props = { 20 opened: boolean, 21 changeContent: string => void, 22 active: string, 23 content: Content, 24 shouldUpdate: Object, 25 }; 26 27 // Body renders the body of the dashboard. 28 class Body extends Component<Props> { 29 render() { 30 return ( 31 <div style={styles.body}> 32 <SideBar 33 opened={this.props.opened} 34 changeContent={this.props.changeContent} 35 /> 36 <Main 37 active={this.props.active} 38 content={this.props.content} 39 shouldUpdate={this.props.shouldUpdate} 40 /> 41 </div> 42 ); 43 } 44 } 45 46 export default Body;