ProjectForm.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import React from 'react'
  2. import styled from 'styled-components'
  3. import gql from 'graphql-tag'
  4. import { Query } from 'react-apollo'
  5. const StyledProjectForm = styled.form`
  6. display: grid;
  7. font-family: "Arial";
  8. label {
  9. display: block;
  10. color: ${props => props.theme.grey};
  11. font-weight: bold;
  12. font-size: 80%;
  13. }
  14. input, textarea {
  15. border: none;
  16. border-bottom: 2px solid red;
  17. }
  18. #project-name {
  19. font-size: 115%;
  20. font-weight: bold;
  21. }
  22. `
  23. class ProjectForm extends React.Component {
  24. saveForm = event => {
  25. event.preventDefault()
  26. console.log(event.target)
  27. }
  28. render() {
  29. return (
  30. <StyledProjectForm>
  31. <h1>Project Setup</h1>
  32. <p>Please fill in the form.</p>
  33. <fieldset id='project-generic'>
  34. <label htmlFor='project-name'>Project name</label>
  35. <input type='text' id='project-name' placeholder='Project name' />
  36. <label htmlFor='project-abbreviation'>Project abbreviation</label>
  37. <input type='text' id='project-abbreviation' placeholder='Project abbreviation' />
  38. <label htmlFor='project-description'>Project description</label>
  39. <textarea id='project-description' placeholder='Project description' />
  40. </fieldset>
  41. <button type='submit' onClick={this.saveForm}>Save</button>
  42. </StyledProjectForm>
  43. )
  44. }
  45. }
  46. export default ProjectForm