Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2079 Rev 2080
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
-
 
2
import {
-
 
3
  FormControl,
-
 
4
  InputAdornment,
-
 
5
  InputBase,
-
 
6
  InputLabel,
-
 
7
  styled
-
 
8
} from '@mui/material'
2
import { FormControl, InputBase, InputLabel, styled } from '@mui/material'
9
import FormErrorFeedback from '../form/FormErrorFeedback'
Línea 3... Línea 10...
3
 
10
 
4
const AppInput = styled(InputBase)(({ theme }) => ({
11
const AppInput = styled(InputBase)(({ theme }) => ({
5
  '& .MuiInputBase-input': {
12
  '& .MuiInputBase-input': {
6
    borderRadius: 4,
13
    borderRadius: 4,
Línea 18... Línea 25...
18
  '& svg': {
25
  '& svg': {
19
    fontSize: '1.3rem'
26
    fontSize: '1.3rem'
20
  }
27
  }
21
}))
28
}))
Línea 22... Línea 29...
22
 
29
 
-
 
30
const Input = ({
-
 
31
  label = '',
-
 
32
  inputRef = null,
-
 
33
  icon: Icon = null,
-
 
34
  error = null,
-
 
35
  name = '',
-
 
36
  onChange = () => {},
-
 
37
  value = '',
-
 
38
  type = 'text',
-
 
39
  placeholder = '',
-
 
40
  accept = '',
-
 
41
  className = '',
-
 
42
  id = ''
23
const Input = ({ label, ...props }) => {
43
}) => {
24
  return (
44
  return (
25
    <FormControl variant='standard' fullWidth>
45
    <FormControl variant='standard' fullWidth>
-
 
46
      <InputLabel shrink>{label}</InputLabel>
-
 
47
      <AppInput
-
 
48
        id={id}
-
 
49
        className={className}
-
 
50
        name={name}
-
 
51
        onChange={onChange}
-
 
52
        value={value}
-
 
53
        type={type}
-
 
54
        placeholder={placeholder}
-
 
55
        inputRef={inputRef}
-
 
56
        accept={accept}
-
 
57
        startAdornment={
-
 
58
          Icon ? (
-
 
59
            <InputAdornment>
-
 
60
              <Icon />
-
 
61
            </InputAdornment>
-
 
62
          ) : null
26
      <InputLabel shrink>{label}</InputLabel>
63
        }
-
 
64
        fullWidth
-
 
65
      />
27
      <AppInput {...props} fullWidth />
66
      {error ? <FormErrorFeedback>{error}</FormErrorFeedback> : null}
28
    </FormControl>
67
    </FormControl>
29
  )
68
  )
Línea 30... Línea 69...
30
}
69
}