Body.jsx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // @flow
  2. // Copyright 2017 The go-ethereum Authors
  3. // This file is part of the go-ethereum library.
  4. //
  5. // The go-ethereum library is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU Lesser General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // The go-ethereum library is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU Lesser General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU Lesser General Public License
  16. // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
  17. import React, {Component} from 'react';
  18. import SideBar from './SideBar';
  19. import Main from './Main';
  20. import type {Content} from '../types/content';
  21. // styles contains the constant styles of the component.
  22. const styles = {
  23. body: {
  24. display: 'flex',
  25. width: '100%',
  26. height: '92%',
  27. },
  28. };
  29. export type Props = {
  30. opened: boolean,
  31. changeContent: string => void,
  32. active: string,
  33. content: Content,
  34. shouldUpdate: Object,
  35. send: string => void,
  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. send={this.props.send}
  51. />
  52. </div>
  53. );
  54. }
  55. }
  56. export default Body;