Advertisement
Fahim_7861

Untitled

Apr 11th, 2021
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. import React from "react";
  2. import Modal from "react-modal";
  3. import wrongSign from "../../assets/images/wrongSign.png";
  4. import ReactDOM from 'react-dom';
  5. const customStyles = {
  6. content: {
  7. top: "50%",
  8. left: "50%",
  9. right: "auto",
  10. bottom: "auto",
  11. marginRight: "-50%",
  12. border: "none",
  13.  
  14. transform: "translate(-50%, -50%)",
  15. },
  16. };
  17.  
  18. // Make sure to bind modal to your appElement (http://reactcommunity.org/react-modal/accessibility/)
  19. Modal.setAppElement("#root");
  20.  
  21. function JoinModal({modalState, modalIsOpen,closeModal,JoinExam}) {
  22.  
  23. //console.log('modalState',modalState);
  24.  
  25.  
  26.  
  27. return (
  28. <div>
  29.  
  30. <Modal
  31. isOpen={modalIsOpen}
  32. onRequestClose={closeModal}
  33. style={customStyles}
  34. contentLabel="Example Modal"
  35. >
  36. <div
  37. className="card"
  38. style={{
  39. fontFamily: "Arial, Helvetica, sans-serif",
  40. borderRadius: "30px",
  41. boxShadow: "0 4px 8px 0 rgba(0,0,0,0.2)",
  42. transition: "0.3s",
  43. textAlign: "center",
  44. alignItems: "center",
  45. padding: "30px",
  46. border: "none",
  47. }}
  48. >
  49. <div style={{ color: "#3D69A8" }}>
  50. <h1 style={{ fontWeight: "bold" }}>Join Quiz</h1>
  51. </div>
  52.  
  53. <div style={{ marginTop: "20px" }}>
  54. <h5>Are you sure to join in this quiz?</h5>
  55. </div>
  56.  
  57. <div style={{ padding: "10px" }}>
  58. <button
  59. onClick={JoinExam}
  60. style={{
  61. fontWeight: "20px",
  62. borderRadius: "10px",
  63. marginTop: "15px",
  64. width: "90px",
  65. height: "50px",
  66. fontSize: "20px",
  67. backgroundColor: "#4067B2",
  68. color: "white",
  69. }}
  70.  
  71. >
  72. YES
  73. </button>
  74. </div>
  75. </div>
  76.  
  77. <div
  78. style={{
  79. marginTop: "-20px",
  80. borderRadius: "30px",
  81. backgroundColor: "#4067B2",
  82. boxShadow: "0 4px 8px 0 rgba(0,0,0,0.2)",
  83. transition: "0.3s",
  84. textAlign: "center",
  85. alignItems: "center",
  86. padding: "10px",
  87. border: "none",
  88. }}
  89. >
  90. <img
  91. onClick={() => closeModal("close")}
  92. src={wrongSign}
  93. style={{
  94. height: "65px",
  95. width: "65px",
  96. margin: "20px 0px",
  97. padding: "5px",
  98. }}
  99. ></img>
  100. </div>
  101. </Modal>
  102. </div>
  103. );
  104. }
  105.  
  106. export default JoinModal;
  107.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement