Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. import React, { Component } from "react";
  2. import PropTypes from "prop-types";
  3.  
  4. import { SplitPaneContext } from './context';
  5.  
  6. import styles from "./splitScreen.scss";
  7.  
  8. const SplitPaneContext = React.createContext('default');
  9.  
  10. class SplitScreen extends Component {
  11. render() {
  12. const { topPane, bottomPane} = this.props;
  13.  
  14. return (
  15. <div className={styles.splitScreen}>
  16. <div className={styles.topPane}>
  17. <SplitPaneContext.Provider value="top">
  18. {topPane}
  19. </SplitPaneContext.Provider>
  20. <div id="modal-root-top" />
  21. </div>
  22. <div className={styles.bottomPane}>
  23. <SplitPaneContext.Provider value="bottom">
  24. {bottomPane}
  25. </SplitPaneContext.Provider>
  26. <div id="modal-root-bottom" />
  27. </div>
  28. </div>
  29. );
  30. }
  31. }
  32.  
  33. SplitScreen.propTypes = {
  34. topPane: PropTypes.node.isRequired,
  35. bottomPane: PropTypes.node.isRequired
  36. };
  37.  
  38. export default SplitScreen;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement