Skip to content

Commit

Permalink
Merge pull request #3575 from marmelab/inputs-typescript
Browse files Browse the repository at this point in the history
[RFR] Migrate Inputs To TypeScript/hooks
  • Loading branch information
fzaninotto authored Aug 22, 2019
2 parents 71226da + e9037b8 commit eb58e88
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import React from 'react';
import React, { FunctionComponent } from 'react';
import PropTypes from 'prop-types';
import SearchIcon from '@material-ui/icons/Search';
import InputAdornment from '@material-ui/core/InputAdornment';
import { withStyles, createStyles } from '@material-ui/core/styles';
import { useTranslate } from 'ra-core';
import { makeStyles, InputAdornment } from '@material-ui/core';
import { TextFieldProps } from '@material-ui/core/TextField';
import { useTranslate, InputProps } from 'ra-core';

import TextInput from './TextInput';

const searchFilterStyles = createStyles({
const useStyles = makeStyles({
input: {
marginTop: 32,
},
});

const SearchInput = ({ classes, ...props }) => {
const SearchInput: FunctionComponent<
InputProps<TextFieldProps> & Omit<TextFieldProps, 'label' | 'helperText'>
> = ({ classes: classesOverride, ...props }) => {
const translate = useTranslate();
const classes = useStyles({ classes: classesOverride });

return (
<TextInput
label={false}
Expand All @@ -36,4 +40,4 @@ SearchInput.propTypes = {
classes: PropTypes.object,
};

export default withStyles(searchFilterStyles)(SearchInput);
export default SearchInput;

0 comments on commit eb58e88

Please sign in to comment.