Skip to content

Commit

Permalink
Add name to remaining files
Browse files Browse the repository at this point in the history
  • Loading branch information
DanudeSandstorm committed Nov 25, 2019
1 parent aebd94e commit fd7ba05
Show file tree
Hide file tree
Showing 61 changed files with 950 additions and 775 deletions.
2 changes: 1 addition & 1 deletion packages/ra-input-rich-text/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { makeStyles } from '@material-ui/core/styles';

import styles from './styles';

const useStyles = makeStyles(styles);
const useStyles = makeStyles(styles, { name: 'RichTextInput' });

const RichTextInput = ({
options = {}, // Quill editor options
Expand Down
15 changes: 9 additions & 6 deletions packages/ra-ui-materialui/src/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import classNames from 'classnames';
import { Link as RRLink } from 'react-router-dom';
import { makeStyles } from '@material-ui/core/styles';

const useStyles = makeStyles(theme => ({
link: {
textDecoration: 'none',
color: theme.palette.primary.main,
},
}));
const useStyles = makeStyles(
theme => ({
link: {
textDecoration: 'none',
color: theme.palette.primary.main,
},
}),
{ name: 'Link' }
);

const Link = ({
to,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/auth/Logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const useStyles = makeStyles(
},
icon: { minWidth: theme.spacing(5) },
}),
{ name: 'LogoutWithRef' }
{ name: 'Logout' }
);

/**
Expand Down
23 changes: 13 additions & 10 deletions packages/ra-ui-materialui/src/button/DeleteWithUndoButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,21 @@ export const sanitizeRestProps = ({
...rest
}) => rest;

const useStyles = makeStyles(theme => ({
deleteButton: {
color: theme.palette.error.main,
'&:hover': {
backgroundColor: fade(theme.palette.error.main, 0.12),
// Reset on mouse devices
'@media (hover: none)': {
backgroundColor: 'transparent',
const useStyles = makeStyles(
theme => ({
deleteButton: {
color: theme.palette.error.main,
'&:hover': {
backgroundColor: fade(theme.palette.error.main, 0.12),
// Reset on mouse devices
'@media (hover: none)': {
backgroundColor: 'transparent',
},
},
},
},
}));
}),
{ name: 'DeleteWithUndoButton' }
);

const DeleteWithUndoButton = ({
label = 'ra.action.delete',
Expand Down
25 changes: 14 additions & 11 deletions packages/ra-ui-materialui/src/button/SaveButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ import ContentSave from '@material-ui/icons/Save';
import classnames from 'classnames';
import { useTranslate, useNotify } from 'ra-core';

const useStyles = makeStyles(theme => ({
button: {
position: 'relative',
},
leftIcon: {
marginRight: theme.spacing(1),
},
icon: {
fontSize: 18,
},
}));
const useStyles = makeStyles(
theme => ({
button: {
position: 'relative',
},
leftIcon: {
marginRight: theme.spacing(1),
},
icon: {
fontSize: 18,
},
}),
{ name: 'SaveButton' }
);

const sanitizeRestProps = ({
basePath,
Expand Down
29 changes: 16 additions & 13 deletions packages/ra-ui-materialui/src/detail/Create.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,23 @@ Create.propTypes = {
successMessage: PropTypes.string,
};

const useStyles = makeStyles(theme => ({
root: {},
main: {
display: 'flex',
},
noActions: {
[theme.breakpoints.up('sm')]: {
marginTop: '1em',
const useStyles = makeStyles(
theme => ({
root: {},
main: {
display: 'flex',
},
},
card: {
flex: '1 1 auto',
},
}));
noActions: {
[theme.breakpoints.up('sm')]: {
marginTop: '1em',
},
},
card: {
flex: '1 1 auto',
},
}),
{ name: 'Create' }
);

const sanitizeRestProps = ({
actions,
Expand Down
25 changes: 14 additions & 11 deletions packages/ra-ui-materialui/src/detail/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,21 @@ Edit.propTypes = {
successMessage: PropTypes.string,
};

export const useStyles = makeStyles({
root: {},
main: {
display: 'flex',
export const useStyles = makeStyles(
{
root: {},
main: {
display: 'flex',
},
noActions: {
marginTop: '1em',
},
card: {
flex: '1 1 auto',
},
},
noActions: {
marginTop: '1em',
},
card: {
flex: '1 1 auto',
},
});
{ name: 'Edit' }
);

const sanitizeRestProps = ({
data,
Expand Down
25 changes: 14 additions & 11 deletions packages/ra-ui-materialui/src/detail/Show.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,21 @@ Show.propTypes = {
title: PropTypes.node,
};

export const useStyles = makeStyles({
root: {},
main: {
display: 'flex',
export const useStyles = makeStyles(
{
root: {},
main: {
display: 'flex',
},
noActions: {
marginTop: '1em',
},
card: {
flex: '1 1 auto',
},
},
noActions: {
marginTop: '1em',
},
card: {
flex: '1 1 auto',
},
});
{ name: 'Show' }
);

const sanitizeRestProps = ({
actions,
Expand Down
17 changes: 10 additions & 7 deletions packages/ra-ui-materialui/src/detail/TabbedShowLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ const sanitizeRestProps = ({
...rest
}) => rest;

const useStyles = makeStyles(theme => ({
content: {
paddingTop: theme.spacing(1),
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2),
},
}));
const useStyles = makeStyles(
theme => ({
content: {
paddingTop: theme.spacing(1),
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2),
},
}),
{ name: 'TabbedShow' }
);

/**
* Tabbed Layout for a Show view, showing fields grouped in tabs.
Expand Down
31 changes: 17 additions & 14 deletions packages/ra-ui-materialui/src/field/BooleanField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,28 @@ import { useTranslate } from 'ra-core';
import { FieldProps, InjectedFieldProps, fieldPropTypes } from './types';
import sanitizeRestProps from './sanitizeRestProps';

const useStyles = makeStyles({
label: {
// Move the text out of the flow of the container.
position: 'absolute',
const useStyles = makeStyles(
{
label: {
// Move the text out of the flow of the container.
position: 'absolute',

// Reduce its height and width to just one pixel.
height: 1,
width: 1,
// Reduce its height and width to just one pixel.
height: 1,
width: 1,

// Hide any overflowing elements or text.
overflow: 'hidden',
// Hide any overflowing elements or text.
overflow: 'hidden',

// Clip the box to zero pixels.
clip: 'rect(0, 0, 0, 0)',
// Clip the box to zero pixels.
clip: 'rect(0, 0, 0, 0)',

// Text won't wrap to a second line.
whiteSpace: 'nowrap',
// Text won't wrap to a second line.
whiteSpace: 'nowrap',
},
},
});
{ name: 'BooleanField' }
);

interface Props extends FieldProps {
valueLabelTrue?: string;
Expand Down
9 changes: 6 additions & 3 deletions packages/ra-ui-materialui/src/field/ChipField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ import classnames from 'classnames';
import sanitizeRestProps from './sanitizeRestProps';
import { FieldProps, InjectedFieldProps, fieldPropTypes } from './types';

const useStyles = makeStyles({
chip: { margin: 4 },
});
const useStyles = makeStyles(
{
chip: { margin: 4 },
},
{ name: 'ChipField' }
);

export const ChipField: FunctionComponent<
FieldProps & InjectedFieldProps & ChipProps
Expand Down
9 changes: 6 additions & 3 deletions packages/ra-ui-materialui/src/field/FileField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import classnames from 'classnames';
import sanitizeRestProps from './sanitizeRestProps';
import { FieldProps, InjectedFieldProps, fieldPropTypes } from './types';

const useStyles = makeStyles({
root: { display: 'inline-block' },
});
const useStyles = makeStyles(
{
root: { display: 'inline-block' },
},
{ name: 'FileField' }
);

interface Props extends FieldProps {
src?: string;
Expand Down
21 changes: 12 additions & 9 deletions packages/ra-ui-materialui/src/field/ImageField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ import classnames from 'classnames';
import sanitizeRestProps from './sanitizeRestProps';
import { FieldProps, InjectedFieldProps, fieldPropTypes } from './types';

const useStyles = makeStyles({
list: {
display: 'flex',
listStyleType: 'none',
const useStyles = makeStyles(
{
list: {
display: 'flex',
listStyleType: 'none',
},
image: {
margin: '0.5rem',
maxHeight: '10rem',
},
},
image: {
margin: '0.5rem',
maxHeight: '10rem',
},
});
{ name: 'ImageField' }
);

interface Props extends FieldProps {
src?: string;
Expand Down
9 changes: 6 additions & 3 deletions packages/ra-ui-materialui/src/field/ReferenceArrayField.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ ReferenceArrayField.defaultProps = {
addLabel: true,
};

const useStyles = makeStyles(theme => ({
progress: { marginTop: theme.spacing(2) },
}));
const useStyles = makeStyles(
theme => ({
progress: { marginTop: theme.spacing(2) },
}),
{ name: 'ReferenceArrayField' }
);

export const ReferenceArrayFieldView = ({
children,
Expand Down
13 changes: 8 additions & 5 deletions packages/ra-ui-materialui/src/field/ReferenceField.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,14 @@ ReferenceField.defaultProps = {
record: {},
};

const useStyles = makeStyles(theme => ({
link: {
color: theme.palette.primary.main,
},
}));
const useStyles = makeStyles(
theme => ({
link: {
color: theme.palette.primary.main,
},
}),
{ name: 'ReferenceField' }
);

// useful to prevent click bubbling in a datagrid with rowClick
const stopPropagation = e => e.stopPropagation();
Expand Down
9 changes: 6 additions & 3 deletions packages/ra-ui-materialui/src/form/FormInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import Labeled from '../input/Labeled';

const sanitizeRestProps = ({ basePath, record, ...rest }) => rest;

const useStyles = makeStyles(theme => ({
input: { width: theme.spacing(32) },
}));
const useStyles = makeStyles(
theme => ({
input: { width: theme.spacing(32) },
}),
{ name: 'FormInput' }
);

export const FormInput = ({ input, classes: classesOverride, ...rest }) => {
const classes = useStyles({ classes: classesOverride });
Expand Down
Loading

0 comments on commit fd7ba05

Please sign in to comment.