Skip to content

Commit ef17f09

Browse files
committed
Fix linter errors in docs components.
1 parent c5f42f2 commit ef17f09

File tree

8 files changed

+45
-29
lines changed

8 files changed

+45
-29
lines changed

packages/react-renderer-demo/src/app/examples/components/clear-on-unmount.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ const ClearOnUnmount = () => {
5353
debug={({ values }) => setValues(values)}
5454
/>
5555
<div style={{ marginTop: 16 }}>
56-
<Typography component="h3" variant="h5">Form values</Typography>
56+
<Typography component="h3" variant="h5">
57+
Form values
58+
</Typography>
5759
<pre>{JSON.stringify(values, null, 2)}</pre>
5860
</div>
5961
</div>

packages/react-renderer-demo/src/app/examples/components/cleared-value.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ const ClearedValueExample = () => {
4040
debug={({ values }) => setValues(values)}
4141
/>
4242
<div style={{ marginTop: 16 }}>
43-
<Typography component="h3" variant="h5">Form values</Typography>
43+
<Typography component="h3" variant="h5">
44+
Form values
45+
</Typography>
4446
<pre>{JSON.stringify(values, null, 2)}</pre>
4547
</div>
4648
</div>

packages/react-renderer-demo/src/app/examples/components/component-mapper/form-fields-mapper.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import useFormApi from '@data-driven-forms/react-form-renderer/dist/cjs/use-form
88
const formGroupStyle = {
99
display: 'flex',
1010
flexDirection: 'column',
11-
marginBottom: 16,
12-
}
11+
marginBottom: 16
12+
};
1313

1414
const inputStyles = {
1515
width: '100%',
@@ -18,22 +18,22 @@ const inputStyles = {
1818
display: 'inline-block',
1919
border: '1px solid #ccc',
2020
borderRadius: 4,
21-
boxSizing: 'border-box',
22-
}
21+
boxSizing: 'border-box'
22+
};
2323

2424
const paragraphStyle = {
2525
marginTop: 0,
26-
marginBottom: 4,
27-
}
26+
marginBottom: 4
27+
};
2828

2929
const requiredStyle = {
3030
color: 'red',
31-
marginLeft: 2,
32-
}
31+
marginLeft: 2
32+
};
3333

3434
const errorStyle = {
3535
color: 'orangered'
36-
}
36+
};
3737

3838
const getButtonStyle = (variant) => ({
3939
color: 'White',
@@ -79,15 +79,20 @@ const TextField = (props) => {
7979
...rest
8080
} = useFieldApi(props);
8181
return (
82-
<div style={{
83-
...formGroupStyle,
84-
...(isRequired && requiredStyle),
85-
...(error && touched && errorStyle)
86-
}}>
87-
<label style={{color: 'initial'}} htmlFor={input.name}>{isRequired && <span style={errorStyle}>*&nbsp;</span>}{label}</label>
82+
<div
83+
style={{
84+
...formGroupStyle,
85+
...(isRequired && requiredStyle),
86+
...(error && touched && errorStyle)
87+
}}
88+
>
89+
<label style={{ color: 'initial' }} htmlFor={input.name}>
90+
{isRequired && <span style={errorStyle}>*&nbsp;</span>}
91+
{label}
92+
</label>
8893
<input style={inputStyles} id={input.name} {...input} {...rest} />
8994
{touched && error && <p style={paragraphStyle}>{error}</p>}
90-
{customProp && <p style={{color: 'initial'}}>This is a custom prop and has nothing to do with form schema</p>}
95+
{customProp && <p style={{ color: 'initial' }}>This is a custom prop and has nothing to do with form schema</p>}
9196
</div>
9297
);
9398
};

packages/react-renderer-demo/src/app/examples/components/data-types-example.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ const DataTypesExample = () => {
4747
debug={({ values }) => setValues(values)}
4848
/>
4949
<div style={{ marginTop: 16 }}>
50-
<Typography component="h3" variant="h5">Form values</Typography>
50+
<Typography component="h3" variant="h5">
51+
Form values
52+
</Typography>
5153
<pre>{JSON.stringify(values, null, 2)}</pre>
5254
</div>
5355
</div>

packages/react-renderer-demo/src/app/examples/components/form-template/custom-buttons.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import useFormApi from '@data-driven-forms/react-form-renderer/dist/cjs/use-form
77
import FormSpy from '@data-driven-forms/react-form-renderer/dist/cjs/form-spy';
88
import TextField from '@data-driven-forms/mui-component-mapper/dist/cjs/text-field';
99
import Button from '@material-ui/core/Button';
10-
import Typography from '@material-ui/core/Typography';
1110

1211
const componentMapper = {
1312
[componentTypes.TEXT_FIELD]: TextField

packages/react-renderer-demo/src/app/examples/components/initialize-mount.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ const componentMapper = {
1515
Summary: () => {
1616
const { getState } = useFormApi();
1717

18-
return <Title size="md">{getState().values['chosen-way']}</Title>;
18+
return (
19+
<Typography component="h5" variant="h5">
20+
{getState().values['chosen-way']}
21+
</Typography>
22+
);
1923
}
2024
};
2125

@@ -93,7 +97,9 @@ const InitializeOnMountWizardExample = () => {
9397
return (
9498
<div>
9599
<div style={{ marginTop: 16, marginBottom: 16 }}>
96-
<Typography component="h3" variant="h5">Form values</Typography>
100+
<Typography component="h3" variant="h5">
101+
Form values
102+
</Typography>
97103
<pre>{JSON.stringify(values, null, 2)}</pre>
98104
</div>
99105
<FormRenderer

packages/react-renderer-demo/src/app/src/components/code-example.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Fragment, useEffect, useState, lazy, useRef } from 'react';
1+
import React, { Fragment, useEffect, useState, useRef } from 'react';
22
import Grid from '@material-ui/core/Grid';
33
import { makeStyles } from '@material-ui/core/styles';
44
import Typography from '@material-ui/core/Typography';
@@ -134,14 +134,14 @@ const getPayload = (type, code, sourceFiles = {}) =>
134134
});
135135

136136
const CodeExample = ({ source, mode, mapper, additionalSources }) => {
137-
const {current: Component} = useRef(mode === 'preview' ? dynamic(import(`@docs/examples/${source}`)) : Fragment)
137+
const { current: Component } = useRef(mode === 'preview' ? dynamic(import(`@docs/examples/${source}`)) : Fragment);
138138
const [codeSource, setCodeSource] = useState('');
139139
const sourceFiles = [];
140140
useEffect(() => {
141-
import(`!raw-loader!@docs/examples/${source}`).then(file => {
142-
setCodeSource(file.default)
143-
})
144-
}, [source])
141+
import(`!raw-loader!@docs/examples/${source}`).then((file) => {
142+
setCodeSource(file.default);
143+
});
144+
}, [source]);
145145
const classes = useStyles();
146146
if (mode === 'preview') {
147147
return (

packages/react-renderer-demo/src/app/src/stackblitz-templates/mui-templates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ export const muiDependencies = {
4242
'@material-ui/core': 'latest',
4343
'@material-ui/icons': 'latest',
4444
'prop-types': 'latest'
45-
};
45+
};

0 commit comments

Comments
 (0)