Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 553 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 553 Rev 616
Línea 1... Línea 1...
1
import React from 'react'
1
import React from "react";
2
import styled from 'styled-components'
2
import styled from "styled-components";
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
import FormErrorFeedback from './FormErrorFeedBack'
4
import FormErrorFeedback from "./FormErrorFeedBack";
5
 
5
 
6
const StyledInput = styled.div`
6
const StyledInput = styled.div`
7
  align-items: center;
7
  align-items: center;
Línea 23... Línea 23...
23
    border: none;
23
    border: none;
24
    outline: none;
24
    outline: none;
25
    background: none;
25
    background: none;
26
    width: 100%;
26
    width: 100%;
27
  }
27
  }
28
`
28
`;
Línea 29... Línea 29...
29
 
29
 
30
const SearchInput = ({
30
const SearchInput = ({
31
  type = 'text',
31
  type = "text",
32
  icon: Icon,
32
  icon: Icon,
33
  name = '',
33
  name = "",
34
  value = '',
34
  value = "",
35
  ref = null,
35
  ref = null,
36
  errors = {},
36
  errors = {},
37
  className = '',
37
  className = "",
38
  onChange = () => {},
38
  onChange = () => {},
-
 
39
  placeholder = "",
39
  placeholder = '',
40
  ...props
40
}) => {
41
}) => {
41
  return (
42
  return (
42
    <StyledInput className={className}>
43
    <StyledInput className={className}>
43
      {Icon && <Icon />}
44
      {Icon && <Icon />}
Línea 46... Línea 47...
46
        name={name}
47
        name={name}
47
        onChange={onChange}
48
        onChange={onChange}
48
        ref={ref}
49
        ref={ref}
49
        placeholder={placeholder}
50
        placeholder={placeholder}
50
        defaultValue={value}
51
        defaultValue={value}
-
 
52
        {...props}
51
      />
53
      />
52
      {errors[name] && (
54
      {errors[name] && (
53
        <FormErrorFeedback>{errors[name].message}</FormErrorFeedback>
55
        <FormErrorFeedback>{errors[name].message}</FormErrorFeedback>
54
      )}
56
      )}
55
    </StyledInput>
57
    </StyledInput>
56
  )
58
  );
57
}
59
};
Línea 58... Línea 60...
58
 
60