github.com/googgoog/go-ethereum@v1.9.7/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:  '92%',
    31  	},
    32  };
    33  
    34  export type Props = {
    35  	opened:        boolean,
    36  	changeContent: string => void,
    37  	active:        string,
    38  	content:       Content,
    39  	shouldUpdate:  Object,
    40  	send:          string => void,
    41  };
    42  
    43  // Body renders the body of the dashboard.
    44  class Body extends Component<Props> {
    45  	render() {
    46  		return (
    47  			<div style={styles.body}>
    48  				<SideBar
    49  					opened={this.props.opened}
    50  					changeContent={this.props.changeContent}
    51  				/>
    52  				<Main
    53  					active={this.props.active}
    54  					content={this.props.content}
    55  					shouldUpdate={this.props.shouldUpdate}
    56  					send={this.props.send}
    57  				/>
    58  			</div>
    59  		);
    60  	}
    61  }
    62  
    63  export default Body;