Skip to content

Commit

Permalink
[RFR] Migrate Inputs To TypeScript/hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Aug 22, 2019
1 parent 18fcff0 commit e9037b8
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 e9037b8

Please sign in to comment.