Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] Migrate Inputs To TypeScript/hooks #3575

Merged
merged 1 commit into from
Aug 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;