Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3517 Rev 5070
Línea 1... Línea 1...
1
/* eslint-disable react/prop-types */
1
/* eslint-disable react/prop-types */
2
import React from 'react'
2
import React from 'react'
3
import { useForm } from "react-hook-form"
3
import { useForm } from 'react-hook-form'
Línea 4... Línea 4...
4
 
4
 
5
export default function SearchList({
5
export default function SearchList ({
6
    title,
6
  title,
7
    fetchCallback,
7
  fetchCallback,
8
    addTitle = '',
8
  addTitle = '',
9
    addCallback = ''
9
  addCallback = ''
-
 
10
}) {
Línea -... Línea 11...
-
 
11
  const { register, getValues } = useForm()
10
}) {
12
 
-
 
13
  const handleSearch = () => {
-
 
14
    const searchValue = getValues('search')
Línea 11... Línea -...
11
 
-
 
12
    const { register, getValues } = useForm();
-
 
13
 
-
 
14
    const handleSearch = () => {
-
 
15
        const searchValue = getValues("search");
-
 
16
        if (fetchCallback) setTimeout(() => fetchCallback(searchValue), [500])
15
    if (fetchCallback) setTimeout(() => fetchCallback(searchValue), [500])
17
    };
16
  }
18
 
17
 
19
    return (
18
  return (
20
        <>
19
        <>
21
            {!!title &&
20
            {!!title &&
Línea 27... Línea 26...
27
                        <h1
26
                        <h1
28
                            className="title"
27
                            className="title"
29
                            style={!addTitle ? { flex: '1', textAlign: 'center' } : {}}
28
                            style={!addTitle ? { flex: '1', textAlign: 'center' } : {}}
30
                        >{title}</h1>
29
                        >{title}</h1>
31
                        {
30
                        {
32
                            (!!addTitle && !!addCallback)
31
                            (!!addTitle && !!addCallback) &&
33
                            &&
-
 
34
                            <h2 className="title" onClick={addCallback}>
32
                            <h2 className="title" onClick={addCallback}>
35
                                {addTitle}
33
                                {addTitle}
36
                            </h2>
34
                            </h2>
37
                        }
35
                        }
38
                    </div>
36
                    </div>
Línea 52... Línea 50...
52
                        />
50
                        />
53
                    </div>
51
                    </div>
54
                </div>
52
                </div>
55
            </div>
53
            </div>
56
        </>
54
        </>
57
    )
55
  )
58
}
56
}