mirror of
https://git.netzspielplatz.de/docker-multiarch/openwrt-firmware-selector.git
synced 2025-11-08 23:39:37 +00:00
Add prettier and bind it with eslint. Also add pre-commit hook to prettify before commit Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import { InputAdornment, makeStyles, TextField } from '@material-ui/core';
|
|
import { fade } from '@material-ui/core/styles';
|
|
import SearchIcon from '@material-ui/icons/Search';
|
|
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
const useStylesSearch = makeStyles(theme => ({
|
|
root: {
|
|
borderColor: '#e2e2e1',
|
|
overflow: 'hidden',
|
|
margin: 0,
|
|
borderRadius: 4,
|
|
transition: theme.transitions.create(['border-color', 'box-shadow']),
|
|
'&:hover': {
|
|
borderColor: fade(theme.palette.primary.main, 0.25),
|
|
},
|
|
'&$focused': {
|
|
backgroundColor: '#fff',
|
|
boxShadow: `${fade(theme.palette.primary.main, 0.25)} 0 0 0 2px`,
|
|
borderColor: theme.palette.primary.main,
|
|
},
|
|
},
|
|
focused: {},
|
|
}));
|
|
|
|
function SearchTextField(props) {
|
|
const classes = useStylesSearch();
|
|
|
|
return (
|
|
<TextField
|
|
variant="outlined"
|
|
label={<div className="search-label">{props.labeltext}</div>}
|
|
disabled={props.disabled}
|
|
InputProps={{
|
|
classes,
|
|
endAdornment: (
|
|
<InputAdornment position="start">
|
|
<SearchIcon className={classes.label} />
|
|
</InputAdornment>
|
|
),
|
|
}}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
SearchTextField.propTypes = {
|
|
labeltext: PropTypes.string,
|
|
disabled: PropTypes.bool,
|
|
};
|
|
|
|
export default SearchTextField;
|