Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 9802 Rev 9812
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React, { useState, useEffect } 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"
-
 
6
import DescriptionInput from '../../../shared/DescriptionInput'
5
import DescriptionInput from '../../../shared/DescriptionInput'
7
import { useHistory } from 'react-router-dom'
6
import { useHistory, useParams } from 'react-router-dom'
-
 
7
import "react-datetime/css/react-datetime.css"
Línea 8... Línea 8...
8
 
8
 
Línea -... Línea 9...
-
 
9
const FormView = ({ actionLink, googleApiKey }) => {
-
 
10
 
-
 
11
  const history = useHistory()
9
const FormView = ({ actionLink, googleApiKey }) => {
12
  let { action } = useParams()
Línea 10... Línea 13...
10
 
13
 
11
  const { handleSubmit, register, setValue } = useForm()
14
  const { handleSubmit, register, setValue } = useForm()
12
 
15
 
Línea 36... Línea 39...
36
 
39
 
37
  const onSubmit = (data) => {
40
  const onSubmit = (data) => {
38
    console.log(data)
41
    console.log(data)
Línea -... Línea 42...
-
 
42
  }
-
 
43
 
-
 
44
  useEffect(() => {
-
 
45
    console.log(action)
39
  }
46
  }, [])
40
 
47
 
41
  return (
48
  return (
42
    <section className="container">
49
    <section className="container">
43
      <div className="row">
50
      <div className="row">
Línea 138... Línea 145...
138
                Guardar
145
                Guardar
139
              </button>
146
              </button>
140
              <button
147
              <button
141
                type="button"
148
                type="button"
142
                className="btn btn-secondary btn-edit-cancel"
149
                className="btn btn-secondary btn-edit-cancel"
143
                onClick={() => useHistory().goBack()}
150
                onClick={() => history.goBack()}
144
              >
151
              >
145
                Cancelar
152
                Cancelar
146
              </button>
153
              </button>
147
            </div>
154
            </div>
148
          </form>
155
          </form>