Skip to content

Commit

Permalink
Merge pull request marmelab#4254 from WiXSL/patch-components-exported…
Browse files Browse the repository at this point in the history
…-twice

Fix Remove redundant components named exports in favor of the default ones.
  • Loading branch information
ThieryMichel committed Jan 8, 2020
2 parents 0964cb7 + 1334059 commit 9455dc8
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/ra-core/src/form/FormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface Props
validate?: Validator | Validator[];
}

export const FormField: FunctionComponent<Props> = ({
const FormField: FunctionComponent<Props> = ({
id,
input,
validate,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/detail/SimpleShowLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const sanitizeRestProps = ({
* );
* export default App;
*/
export const SimpleShowLayout = ({
const SimpleShowLayout = ({
basePath,
className,
children,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/FileField.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import expect from 'expect';
import { FileField } from './FileField';
import FileField from './FileField';
import { render, cleanup } from '@testing-library/react';

const defaultProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/FileField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface Props extends FieldProps {
classes?: object;
}

export const FileField: FunctionComponent<Props & InjectedFieldProps> = ({
const FileField: FunctionComponent<Props & InjectedFieldProps> = ({
className,
classes: classesOverride,
record,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/ImageField.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import expect from 'expect';
import { render, cleanup } from '@testing-library/react';
import { ImageField } from './ImageField';
import ImageField from './ImageField';

const defaultProps = {
classes: {},
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/ImageField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface Props extends FieldProps {
classes?: object;
}

export const ImageField: FunctionComponent<Props & InjectedFieldProps> = ({
const ImageField: FunctionComponent<Props & InjectedFieldProps> = ({
className,
classes: classesOverride,
record,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/ReferenceArrayField.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { fieldPropTypes } from './types';
* </ReferenceArrayField>
*
*/
export const ReferenceArrayField = ({ children, ...props }) => {
const ReferenceArrayField = ({ children, ...props }) => {
if (React.Children.count(children) !== 1) {
throw new Error(
'<ReferenceArrayField> only accepts a single child (like <Datagrid>)'
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/form/FormInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const useStyles = makeStyles(
{ name: 'RaFormInput' }
);

export const FormInput = ({ input, classes: classesOverride, ...rest }) => {
const FormInput = ({ input, classes: classesOverride, ...rest }) => {
const classes = useStyles({ classes: classesOverride });
return input ? (
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/ArrayInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import sanitizeRestProps from './sanitizeRestProps';
*
* @see https://github.com/final-form/react-final-form-arrays
*/
export const ArrayInput = ({
const ArrayInput = ({
className,
defaultValue,
label,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/DateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getStringFromDate = (value: string | Date) => {
return convertDateToString(new Date(value));
};

export const DateInput: FunctionComponent<
const DateInput: FunctionComponent<
InputProps<TextFieldProps> & Omit<TextFieldProps, 'helperText' | 'label'>
> = ({
format = getStringFromDate,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/DateTimeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const parseDateTime = (value: string) => new Date(value);
/**
* Input component for entering a date and a time with timezone, using the browser locale
*/
export const DateTimeInput: FunctionComponent<
const DateTimeInput: FunctionComponent<
InputProps<TextFieldProps> & Omit<TextFieldProps, 'helperText' | 'label'>
> = ({
format = formatDateTime,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/Labeled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ interface Props {
* <FooComponent source="title" />
* </Labeled>
*/
export const Labeled: FunctionComponent<Props> = ({
const Labeled: FunctionComponent<Props> = ({
children,
className,
classes: classesOverride,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const useStyles = makeStyles(
*
* The object passed as `options` props is passed to the material-ui <RadioButtonGroup> component
*/
export const RadioButtonGroupInput: FunctionComponent<
const RadioButtonGroupInput: FunctionComponent<
ChoicesProps & InputProps<RadioGroupProps> & FormControlProps
> = ({
choices = [],
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/ReferenceArrayInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ import ReferenceError from './ReferenceError';
* <SelectArrayInput optionText="name" />
* </ReferenceArrayInput>
*/
export const ReferenceArrayInput = ({
const ReferenceArrayInput = ({
children,
id: idOverride,
onBlur,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/ReferenceInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ interface Props {
* <SelectInput optionText="title" />
* </ReferenceInput>
*/
export const ReferenceInput: FunctionComponent<Props & InputProps> = ({
const ReferenceInput: FunctionComponent<Props & InputProps> = ({
format,
onBlur,
onChange,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/input/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type TextInputProps = InputProps<TextFieldProps> &
*
* The object passed as `options` props is passed to the <ResettableTextField> component
*/
export const TextInput: FunctionComponent<TextInputProps> = ({
const TextInput: FunctionComponent<TextInputProps> = ({
label,
format,
helperText,
Expand Down
6 changes: 1 addition & 5 deletions packages/ra-ui-materialui/src/layout/LoadingIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ const useStyles = makeStyles(
{ name: 'RaLoadingIndicator' }
);

export const LoadingIndicator = ({
classes: classesOverride,
className,
...rest
}) => {
const LoadingIndicator = ({ classes: classesOverride, className, ...rest }) => {
const loading = useSelector(state => state.admin.loading > 0);
const classes = useStyles({ classes: classesOverride });
return loading ? (
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/list/DatagridCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const sanitizeRestProps = ({
...rest
}) => rest;

export const DatagridCell = ({
const DatagridCell = ({
className,
field,
record,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/list/DatagridCell.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { shallow } from 'enzyme';

import { DatagridCell } from './DatagridCell';
import DatagridCell from './DatagridCell';

describe('<DatagridCell />', () => {
const Field = () => <div />;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/list/Filter.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, cleanup } from '@testing-library/react';
import { TextInput } from '../input/TextInput';
import TextInput from '../input/TextInput';
import Filter from './Filter';

describe('<Filter />', () => {
Expand Down

0 comments on commit 9455dc8

Please sign in to comment.