Guest User

Untitled

a guest
Dec 13th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import ReactDOM from 'react-dom';
  3. import ModelDialog from './modal-dialog';
  4.  
  5.  
  6. export default class ButtonRoot extends Component{
  7. render(){
  8.  
  9. // Get the button that opens the modal
  10. var btn = document.getElementById("base-btn");
  11.  
  12. // When the user clicks the button, open the modal
  13. btn.onclick = function() {
  14. modal.style.display = "block";
  15. }
  16.  
  17. return (
  18. <button id='base-btn'>Order Credit</button>
  19. );
  20. }
  21. }
  22.  
  23. import React, { Component } from 'react';
  24. import ReactDOM from 'react-dom';
  25.  
  26.  
  27. export default class ModelDialog extends Component {
  28. render(){
  29. // Get the modal
  30. var modal = document.getElementById('myModal');
  31.  
  32. // Get the <span> element that closes the modal
  33. var span = document.getElementsByClassName("close")[0];
  34.  
  35. return(
  36. <div id="myModal" className="modal">
  37. <div className="modal-content">
  38. <span className="close">&times;</span>
  39. <div className="order--container">
  40. <p>5 IV's</p>
  41. <p>25 IV's</p>
  42. <p>50 IV's</p>
  43. <p>100 IV's</p>
  44. <p>500 IV's</p>
  45. </div>
  46. <div className="order--form">
  47. <form>
  48. <div className="tc--checkbox">
  49. <input type="checkbox" id="subscribeNews" name="subscribe" value="newsletter" />
  50. <label for="tcs">I accept Terms & Conditions</label>
  51. </div>
  52. <div className="order--btn">
  53. <button type="submit">Order</button>
  54. </div>
  55. </form>
  56. </div>
  57. </div>
  58. </div>
  59. );
  60. }
  61. }
Add Comment
Please, Sign In to add comment