Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 9791 | Rev 9812 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 9791 Rev 9802
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React, { useState } from 'react'
2
import { useForm } from 'react-hook-form'
2
import { useForm } from 'react-hook-form'
3
import Datetime from 'react-datetime'
3
import Datetime from 'react-datetime'
4
import SearchLocationInput from '../../../shared/SearchLocationInput'
4
import SearchLocationInput from '../../../shared/SearchLocationInput'
5
import "react-datetime/css/react-datetime.css"
5
import "react-datetime/css/react-datetime.css"
-
 
6
import DescriptionInput from '../../../shared/DescriptionInput'
-
 
7
import { useHistory } from 'react-router-dom'
Línea 6... Línea 8...
6
 
8
 
Línea 7... Línea 9...
7
const FormView = ({ actionLink, googleApiKey }) => {
9
const FormView = ({ actionLink, googleApiKey }) => {
-
 
10
 
8
 
11
  const { handleSubmit, register, setValue } = useForm()
-
 
12
 
9
  const { handleSubmit, register } = useForm()
13
  const [location, setLocation] = useState({})
10
  const [location, setLocation] = useState({})
14
  const [isActive, setIsActive] = useState(false)
11
  const [year, setYear] = useState(new Date())
15
  const [year, setYear] = useState(new Date())
12
  const [locationLabel, setLocationLabel] = useState('')
16
  const [locationLabel, setLocationLabel] = useState('')
13
  const [jobsDescriptions, setJobsDescriptions] = useState([
17
  const [jobsDescriptions, setJobsDescriptions] = useState([
Línea 31... Línea 35...
31
 
35
 
32
 
36
 
33
  const onSubmit = (data) => {
37
  const onSubmit = (data) => {
-
 
38
    console.log(data)
34
    console.log(data)
39
  }
35
  }
40
 
36
  return (
41
  return (
37
    <section className="container">
42
    <section className="container">
38
      <div className="row">
43
      <div className="row">
Línea 96... Línea 101...
96
                }
101
                }
97
                inputProps={{ className: 'form-control' }}
102
                inputProps={{ className: 'form-control' }}
98
                closeOnSelect
103
                closeOnSelect
99
              />
104
              />
100
            </div>
105
            </div>
-
 
106
            <div className="form-group">
-
 
107
              <label>Descripción</label>
-
 
108
              <DescriptionInput
-
 
109
                setValue={setValue}
-
 
110
                name="description"
-
 
111
              />
-
 
112
            </div>
-
 
113
            <div className="form-group">
-
 
114
              <label>Estatus</label>
-
 
115
              <div
-
 
116
                className={`toggle btn btn-block btn-primary ${!isActive && "off"}`}
-
 
117
                data-toggle="toggle"
-
 
118
                role="button"
-
 
119
                style={{ width: '130px' }}
-
 
120
                onClick={() => setIsActive(!isActive)}
-
 
121
              >
-
 
122
                <input
-
 
123
                  type="checkbox"
-
 
124
                  checked={isActive}
-
 
125
                />
-
 
126
                <div className="toggle-group">
-
 
127
                  <label for="status" className="btn btn-primary toggle-on">Activo</label>
-
 
128
                  <label for="status" className="btn btn-light toggle-off">Inactivo</label>
-
 
129
                  <span className="toggle-handle btn btn-light"></span>
-
 
130
                </div>
-
 
131
              </div>
-
 
132
            </div>
-
 
133
            <div className="form-group">
-
 
134
              <button
-
 
135
                type="submit"
-
 
136
                className="btn btn-primary btn-form-save-close"
-
 
137
              >
-
 
138
                Guardar
-
 
139
              </button>
-
 
140
              <button
-
 
141
                type="button"
-
 
142
                className="btn btn-secondary btn-edit-cancel"
-
 
143
                onClick={() => useHistory().goBack()}
-
 
144
              >
-
 
145
                Cancelar
-
 
146
              </button>
-
 
147
            </div>
101
          </form>
148
          </form>
102
        </div>
149
        </div>
103
      </div>
150
      </div>
104
    </section>
151
    </section>
105
  )
152
  )