Advertisement
vandasche

Untitled

Apr 8th, 2020
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.54 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import {
  3. Container,
  4. Row,
  5. FormControl,
  6. Col,
  7. Form,
  8. Button,
  9. Jumbotron,
  10. DropdownButton,
  11. Dropdown,
  12. Modal,
  13. } from 'react-bootstrap';
  14. import logo from '../pic/Icon.png';
  15.  
  16. export default class Header extends Component {
  17. state = {
  18. modalup: false,
  19. modalin: false,
  20. };
  21. signupClose = () => {
  22. this.setState({ modalup: false });
  23. };
  24. signupOpen = () => {
  25. this.setState({ modalup: true });
  26. };
  27. singinClose = () => {
  28. this.setState({ modalin: false });
  29. };
  30. singinOpen = () => {
  31. this.setState({ modalin: true });
  32. };
  33. render() {
  34. return (
  35. <div>
  36. <div>
  37. <Jumbotron>
  38. <Container>
  39. <Row>
  40. <Col>
  41. ````
  42. <span>
  43. <img src={logo} alt='logo' />
  44. </span>
  45. </Col>
  46. <Col>
  47. <Form inline className='search'>
  48. <FormControl
  49. type='text'
  50. placeholder='Tangerang Selatan'
  51. className='mr-sm-2'
  52. />
  53. <Button variant='outline-success'>Search</Button>
  54. </Form>
  55. </Col>
  56. <Col>
  57. <div className='sign'>
  58. <Button
  59. onClick={this.signinOpen}
  60. variant='light'
  61. style={{ marginRight: '20px' }}
  62. >
  63. Sign In
  64. </Button>
  65. <Singin
  66. visible={this.state.modalin}
  67. onClose={this.singinClose}
  68. />
  69.  
  70. <Button onClick={this.signupOpen} variant='dark'>
  71. Sign Up
  72. </Button>
  73. <Singup
  74. visible={this.state.modalup}
  75. onClose={this.signupClose}
  76. />
  77. </div>
  78. </Col>
  79. </Row>
  80. </Container>
  81. </Jumbotron>
  82. </div>
  83. </div>
  84. );
  85. }
  86. }
  87.  
  88. class Singup extends Component {
  89. constructor(props) {
  90. super(props);
  91. }
  92.  
  93. render() {
  94. return (
  95. <div>
  96. <Modal
  97. show={this.props.visible}
  98. onHide={this.props.onClose}
  99. size='lg'
  100. aria-labelledby='contained-modal-title-vcenter'
  101. centered
  102. >
  103. <Modal.Header closeButton></Modal.Header>
  104. <Modal.Body>
  105. <Form>
  106. <h1 style={{ textAlign: 'center' }}>SIGN IN</h1>
  107. <Form.Group controlId='formBasicName'>
  108. <Form.Label>Fullname</Form.Label>
  109. <Form.Control type='email' placeholder='Enter Fullname' />
  110. </Form.Group>
  111. <Form.Group controlId='formBasicUname'>
  112. <Form.Label>Username</Form.Label>
  113. <Form.Control type='text' placeholder='Enter Username' />
  114. </Form.Group>
  115. <Form.Group controlId='formBasicEmail'>
  116. <Form.Label>Email</Form.Label>
  117. <Form.Control type='email' placeholder='Enter Email' />
  118. </Form.Group>
  119. <Form.Group controlId='formBasicPassword'>
  120. <Form.Label>Password</Form.Label>
  121. <Form.Control type='password' placeholder='Enter Password' />
  122. </Form.Group>
  123. <Form.Group>
  124. <Form.Label>List as</Form.Label>
  125. <DropdownButton
  126. id='dropdown-basic-button'
  127. title='Select your status'
  128. >
  129. <Dropdown.Item href='#/action-1'>User</Dropdown.Item>
  130. <Dropdown.Item href='#/action-2'>Owner</Dropdown.Item>
  131. </DropdownButton>
  132. </Form.Group>{' '}
  133. <Form.Group>
  134. <Form.Label>Gender</Form.Label>
  135. <DropdownButton
  136. id='dropdown-basic-button'
  137. title='Select your gender'
  138. >
  139. <Dropdown.Item href='#/action-1'>Male</Dropdown.Item>
  140. <Dropdown.Item href='#/action-2'>Female</Dropdown.Item>
  141. </DropdownButton>
  142. </Form.Group>
  143. <Form.Group controlId='exampleForm.ControlTextarea1'>
  144. <Form.Label>Address</Form.Label>
  145. <Form.Control as='textarea' rows='3' />
  146. </Form.Group>
  147. <div style={{ display: 'flex', justifyContent: 'center' }}>
  148. <Button
  149. variant='primary'
  150. style={{ display: 'flex', justifyContent: 'center' }}
  151. onClick={this.handleCloseModal}
  152. >
  153. SIGN IN
  154. </Button>
  155. </div>
  156. </Form>
  157. </Modal.Body>
  158. </Modal>
  159. </div>
  160. );
  161. }
  162. }
  163.  
  164. class Singin extends Component {
  165. constructor(props) {
  166. super(props);
  167. }
  168. render() {
  169. return (
  170. <div>
  171. <Modal
  172. size='lg'
  173. aria-labelledby='contained-modal-title-vcenter'
  174. centered
  175. show={this.props.visible}
  176. onHide={this.props.onClose}
  177. >
  178. <Modal.Header closeButton></Modal.Header>
  179. <Modal.Body>
  180. <Form>
  181. <h1 style={{ textAlign: 'center' }}>SIGN IN</h1>
  182. <Form.Group controlId='formBasicEmail'>
  183. <Form.Label>Email address</Form.Label>
  184. <Form.Control type='email' placeholder='Enter email' />
  185. </Form.Group>
  186.  
  187. <Form.Group controlId='formBasicPassword'>
  188. <Form.Label>Password</Form.Label>
  189. <Form.Control type='password' placeholder='Password' />
  190. </Form.Group>
  191. <Form.Group controlId='formBasicCheckbox'>
  192. <Form.Text className='text-muted'>
  193. Dont have an account? Click Here
  194. </Form.Text>
  195. </Form.Group>
  196. <div style={{ display: 'flex', justifyContent: 'center' }}>
  197. <Button
  198. variant='primary'
  199. style={{ display: 'flex', justifyContent: 'center' }}
  200. onClick={this.handleCloseModal}
  201. >
  202. SIGN IN
  203. </Button>
  204. </div>
  205. </Form>
  206. </Modal.Body>
  207. </Modal>
  208. </div>
  209. );
  210. }
  211. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement