Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2077 Rev 2078
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { InputAdornment, TextField, styled } from '@mui/material'
2
import { FormControl, InputBase, InputLabel, styled } from '@mui/material'
Línea 3... Línea 3...
3
 
3
 
4
const AppInput = styled(TextField)(({ theme }) => ({
4
const AppInput = styled(InputBase)(({ theme }) => ({
5
  '& .MuiInputBase-input': {
5
  '& .MuiInputBase-input': {
6
    borderRadius: 4,
6
    borderRadius: 4,
7
    position: 'relative',
7
    position: 'relative',
8
    backgroundColor: theme.palette.background.default,
8
    backgroundColor: theme.palette.background.default,
Línea 18... Línea 18...
18
  '& svg': {
18
  '& svg': {
19
    fontSize: '1.3rem'
19
    fontSize: '1.3rem'
20
  }
20
  }
21
}))
21
}))
Línea 22... Línea 22...
22
 
22
 
23
const Input = ({
-
 
24
  label = '',
-
 
25
  inputRef = null,
-
 
26
  icon: Icon = null,
-
 
27
  error = null,
-
 
28
  name = '',
-
 
29
  onChange = () => {},
-
 
30
  value = '',
-
 
31
  type = 'text',
-
 
32
  placeholder = '',
-
 
33
  accept = ''
-
 
34
}) => {
23
const Input = ({ label, ...props }) => {
35
  return (
-
 
36
    <AppInput
-
 
37
      label={label}
-
 
38
      helperText={error}
-
 
39
      error={Boolean(error)}
-
 
40
      ref={inputRef}
-
 
41
      id={name}
-
 
42
      name={name}
-
 
43
      fullWidth
24
  return (
44
      placeholder={placeholder}
-
 
45
      onChange={onChange}
-
 
46
      value={value}
-
 
47
      InputProps={{
-
 
48
        startAdornment: Icon ? (
25
    <FormControl variant='standard'>
49
          <InputAdornment position='start'>
-
 
50
            <Icon />
26
      <InputLabel shrink>{label}</InputLabel>
51
          </InputAdornment>
27
      <AppInput {...props} />
52
        ) : null
-
 
53
      }}
-
 
54
      inputProps={{
-
 
55
        accept
-
 
56
      }}
-
 
57
      type={type}
-
 
58
    />
28
    </FormControl>
59
  )
29
  )
Línea 60... Línea 30...
60
}
30
}