Skip to content

Commit 4814884

Browse files
committed
Fix forms/grid
1 parent 830a9f9 commit 4814884

File tree

10 files changed

+35
-55
lines changed

10 files changed

+35
-55
lines changed

src/components/Documentation/Documentation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ const Documentation = (props) => {
5454
justifyContent='space-between'
5555
alignItems='center'
5656
>
57+
58+
{/* eslint-disable-next-line array-callback-return */}
5759
{structure.map((c) => {
5860
if (!c.children && window.location.hash.includes(c.link) && c.link) {
5961
return (

src/pages/CRUD/Users/form/UsersFormPage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const UsersFormPage = (props) => {
3939
}
4040
}
4141
setDispatched(true);
42+
// eslint-disable-next-line react-hooks/exhaustive-deps
4243
}, [match, dispatch]);
4344

4445
return (

src/pages/CRUD/Users/table/UsersTable.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@ const UsersTable = () => {
8282

8383
React.useEffect(() => {
8484
loadData(rowsState.pageSize, rowsState.page, sortModel[0], filterUrl);
85+
// eslint-disable-next-line react-hooks/exhaustive-deps
8586
}, [sortModel, rowsState, filterUrl]);
8687

8788
React.useEffect(() => {
8889
updateWindowDimensions();
8990
window.addEventListener('resize', updateWindowDimensions);
9091
return () => window.removeEventListener('resize', updateWindowDimensions);
92+
// eslint-disable-next-line react-hooks/exhaustive-deps
9193
}, []);
9294

9395
const handleSortModelChange = (newModel) => {

src/pages/draggablegrid/Components/AutoloadWidget.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ const AutoloadWidget = ({ classes }) => {
4949
Faith makes it possible to achieve that which man's mind can conceive and believe.
5050
</div>
5151
</Grid>
52-
<Grid container direction={'column'} xs={12}>
52+
<Grid container item direction={'column'} xs={12}>
5353
<Grid item className={classes.blocksMargin}>
5454
<FormGroup>
5555
<div className={classes.formLabels}>
56-
<FormLabel for="exampleInputEmail1">&nbsp; Email address</FormLabel>
56+
<FormLabel htmlFor="exampleInputEmail1">&nbsp; Email address</FormLabel>
5757
</div>
5858
<TextField
5959
id="exampleInputEmail1"
@@ -68,7 +68,7 @@ const AutoloadWidget = ({ classes }) => {
6868
<Grid item className={classes.blocksMargin}>
6969
<FormGroup>
7070
<div className={classes.formLabels}>
71-
<FormLabel for="pswd"><i /> &nbsp; Password</FormLabel>
71+
<FormLabel htmlFor="pswd"><i /> &nbsp; Password</FormLabel>
7272
</div>
7373
<TextField
7474
id="pswd"

src/pages/draggablegrid/Components/CollapsedWidget.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import { withStyles } from '@mui/styles';
33
import { Typography } from '@mui/material';
44

5-
65
const styles = (theme) => ({
76
quote: {
87
fontStyle: 'italic',
@@ -20,7 +19,7 @@ const styles = (theme) => ({
2019

2120
const CollapsedWidget = ({ classes }) => {
2221
return (
23-
<Typography>
22+
<Typography component={'div'}>
2423
<blockquote className={classes.quote}>
2524
"There are no limits. There are plateaus, but you must not stay there, you must go beyond
2625
them. If it kills you, it kills you. A man must constantly exceed his level."

src/pages/draggablegrid/Components/DraggableStory.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React from 'react';
22
import { withStyles } from '@mui/styles';
3-
43
import { Button } from "../../../components/Wrappers";
54

6-
75
const styles = (theme) => ({
86
container: {
97
display: 'flex',
@@ -43,7 +41,12 @@ const DraggableStory = ({ classes }) => {
4341
<p className={classes.header}>Draggable story!</p>
4442
<p className={classes.description}><i>Build</i> your own interfaces! Sit back and relax.</p>
4543
<div>
46-
<Button className={classes.button} size="large" color="warning" variant="contained" style={{ boxShadow: 'none' }}>Fullscreen me!</Button>
44+
<Button
45+
className={classes.button}
46+
size="large"
47+
color="warning"
48+
variant="contained"
49+
style={{ boxShadow: 'none' }}>Fullscreen me!</Button>
4750
</div>
4851
</div>
4952
</div>

src/pages/draggablegrid/Components/WidgsterInfo.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@ const styles = (theme) => ({
1212

1313
const WidgsterInfo = ({ classes }) => {
1414
return (
15-
<Typography>
15+
<Typography block={'div'}>
1616
<p>
17-
<strong>Widgster</strong> is a plugin that allows to easily implement basic widget functions that
18-
lots of our customers have requested. For now it has the following essential
19-
widget features:
17+
<strong>Widgster</strong> is a plugin that allows to easily implement basic widget functions that
18+
lots of our customers have requested. For now it has the following essential
19+
widget features:
2020
</p>
2121
<ul>
2222
<li><strong>Collapse/Expand</strong> - all widgets can be collapsed to fill only header&apos;s
23-
vertical
24-
space;
23+
vertical
24+
space;
2525
</li>
2626
<li><strong>Close</strong> - closable. Any widget may be removed by clicking the close btn;</li>
2727
<li><strong>Full Screen</strong> - an option to make widget fill the whole window (just like OS);</li>
2828
<li><strong>Ajax Load</strong> - the hottest option allowing to load/reload widget content
29-
asynchronously. You just
30-
need to provide an url to fetch the data from. With loader delivered.
29+
asynchronously. You just
30+
need to provide an url to fetch the data from. With loader delivered.
3131
</li>
3232
</ul>
3333
<p>It&apos;s available under MIT license, check out
34-
<a className={classes.link} href="https://github.com/flatlogic/widgster" target="_blank" rel="noopener noreferrer"> github </a>
35-
to find it.</p>
34+
<a className={classes.link} href="https://github.com/flatlogic/widgster" target="_blank" rel="noopener noreferrer"> github </a>
35+
to find it.</p>
3636
<p>
37-
Test it out!
37+
Test it out!
3838
</p>
3939
</Typography>
4040
)

src/pages/draggablegrid/DraggableGrid.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import { Grid, Typography } from '@mui/material';
3-
import { useTheme } from '@mui/styles';
43
import Widget from '../../components/Widget';
54
import Sortable from 'react-sortablejs'
65
// Components
@@ -17,8 +16,6 @@ import useStyles from "./styles";
1716

1817
function DraggableGrid() {
1918
const classes = useStyles();
20-
// eslint-disable-next-line no-unused-vars
21-
const theme = useTheme();
2219

2320
return (
2421
<Grid container spacing={4} className={classes.root}>
@@ -41,11 +38,9 @@ function DraggableGrid() {
4138
className={classes.widgetLayout}
4239
title="Default Widget"
4340
>
44-
<Typography >
4541
{mock.mainData.default.map(item => (
46-
<p key={item.value}>{item.value}</p>
42+
<Typography key={item.value} component="p" gutterBottom>{item.value}</Typography>
4743
))}
48-
</Typography>
4944
</Widget>
5045
</Grid>
5146
<Grid item xs={12} sm={12} md={12} lg={12}>
@@ -100,7 +95,7 @@ function DraggableGrid() {
10095
<Loader />
10196
</Widget>
10297
</Grid>
103-
</Sortable>
98+
</Sortable>
10499
</Grid>
105100
</Grid>
106101
)

src/pages/forms/elements/FormsElements.js

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
Divider,
77
MenuItem,
88
Select,
9-
TextField, TextareaAutosize
9+
TextField,
1010
} from "@mui/material";
1111
import { withStyles } from "@mui/styles";
1212
import useStyles from "./styles";
@@ -49,26 +49,6 @@ const GreenRadio = withStyles({
4949
}
5050
})(props => <Radio color="default" {...props} />);
5151

52-
const SuccessInput = withStyles(theme => ({
53-
root: {
54-
"& .MuiInputLabel-root": {
55-
color: "green"
56-
},
57-
"& .MuiOutlinedInput-root": {
58-
"& fieldset": {
59-
borderColor: "green"
60-
},
61-
"&:hover fieldset": {
62-
borderColor: "green"
63-
},
64-
"&.Mui-focused fieldset": {
65-
borderColor: "green",
66-
borderWidth: 2
67-
}
68-
}
69-
}
70-
}))(props => <Input {...props} />);
71-
7252
const actions = [
7353
{
7454
id: 0,
@@ -523,15 +503,13 @@ export default function FormsElements() {
523503
</Grid>
524504
<Grid item container alignItems="center">
525505
<Grid xs={12} item>
526-
<TextareaAutosize
506+
<TextField
527507
id="outlined-multiline-static"
528508
label="Multiline"
529509
multiline
530-
minRows="4"
510+
rows={4}
531511
defaultValue="Default Value"
532-
margin="none"
533-
variant="outlined"
534-
style={{ width: '100%' }}
512+
style={{marginTop: '1rem', width: '100%'}}
535513
/>
536514
</Grid>
537515
</Grid>

src/pages/forms/validation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ export default () => {
2323
>
2424
<Grid
2525
container
26-
direction={"column"}
26+
direction="column"
2727
alignItems="center"
2828
spacing={6}
2929
>
30-
<Grid item container alignItems={"center"} xs={6}>
30+
<Grid item container alignItems="center" xs={6}>
3131
<Grid item xs={6}>
32-
<Typography variant={"body1"}>Simple required</Typography>
32+
<Typography variant="body1">Simple required</Typography>
3333
</Grid>
3434
<Grid xs={6} item>
3535
<Input

0 commit comments

Comments
 (0)