Skip to content

Commit e5c2da8

Browse files
committed
Add grid page
1 parent 6207db5 commit e5c2da8

File tree

21 files changed

+3878
-3726
lines changed

21 files changed

+3878
-3726
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@
4343
"react-redux": "^7.2.4",
4444
"react-router-dom": "^5.2.0",
4545
"react-scripts": "3.4.3",
46+
"react-sortablejs": "^1.5.1",
4647
"react-swipeable-views": "^0.14.0",
4748
"react-swipeable-views-utils": "^0.14.0",
4849
"react-syntax-highlighter": "^11.0.2",
4950
"recharts": "^2.1.10",
5051
"redux": "^4.0.5",
5152
"redux-thunk": "^2.3.0",
53+
"sortablejs": "^1.15.0",
5254
"tinycolor2": "^1.4.2",
5355
"typescript": "^4.1.2",
5456
"url-loader": "2.3.0",
@@ -72,6 +74,7 @@
7274
"@types/node": "^12.0.0",
7375
"@types/react": "^17.0.0",
7476
"@types/react-dom": "^17.0.0",
77+
"@types/sortablejs": "^1.13.0",
7578
"cross-env": "^7.0.3",
7679
"eslint-plugin-css-modules": "^2.11.0",
7780
"sass": "^1.45.0"

src/components/Layout/Layout.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ import LineCharts from '../../pages/charts/LineCharts'
5353
import BarCharts from '../../pages/charts/BarCharts'
5454
import PieCharts from '../../pages/charts/PieCharts'
5555

56+
import DraggableGrid from '../../pages/draggablegrid'
57+
5658
import BreadCrumbs from '../../components/BreadCrumbs';
5759

5860
// context
@@ -125,6 +127,8 @@ function Layout(props) {
125127
<Route path="/app/charts/bar" component={BarCharts} />
126128
<Route path="/app/charts/pie" component={PieCharts} />
127129

130+
<Route path="/app/grid" component={DraggableGrid} />
131+
128132
/>
129133

130134
<Route path={'/app/api-docs'} exact

src/components/Sidebar/SidebarStructure.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import {
1717
FolderOpen as FolderIcon,
1818
Description as DocumentationIcon,
1919
Person as PersonIcon,
20-
AccountCircle as ProfileIcon,
20+
AccountCircle as ProfileIcon
2121
} from '@mui/icons-material';
22+
import ViewCompactRoundedIcon from '@mui/icons-material/ViewCompactRounded';
2223
import { makeStyles } from '@mui/styles';
2324

2425
// components
@@ -159,6 +160,12 @@ const structure = [
159160
{ label: 'Pie Charts', link: '/app/charts/pie' },
160161
],
161162
},
163+
{
164+
id: 200,
165+
label: 'Grid',
166+
link: '/app/grid',
167+
icon: <ViewCompactRoundedIcon />,
168+
},
162169
];
163170

164171
export default structure;

src/images/grid/a1.jpg

166 KB
Loading

src/images/grid/a2.jpg

170 KB
Loading

src/images/grid/a3.jpg

149 KB
Loading

src/images/grid/a4.jpg

146 KB
Loading

src/images/grid/a5.jpg

149 KB
Loading

src/images/grid/a6.jpg

166 KB
Loading
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
import React from 'react';
2+
import { withStyles } from '@mui/styles';
3+
import { Typography, Grid, FormGroup, FormLabel, TextField } from '@mui/material';
4+
import { Button } from "../../../components/Wrappers";
5+
6+
const styles = (theme) => ({
7+
header: {
8+
display: 'flex',
9+
flexDirection: 'column',
10+
justifyContent: 'center',
11+
alignItems: 'center',
12+
marginTop: 10,
13+
},
14+
headerText: {
15+
textAlign: 'center',
16+
},
17+
description: {
18+
fontSize: '1.25rem',
19+
padding: '5px 30px 15px',
20+
textAlign: 'center',
21+
color: theme.palette.text.secondary
22+
},
23+
label: {
24+
margin: '5px 0',
25+
},
26+
blocksMargin: {
27+
marginBottom: '1rem',
28+
},
29+
buttonsGroup: {
30+
display: 'flex',
31+
flexDirection: 'row',
32+
float: 'right',
33+
},
34+
button: {
35+
marginLeft: '1rem',
36+
},
37+
formLabels: {
38+
padding: 0,
39+
margin: 0,
40+
},
41+
});
42+
43+
const AutoloadWidget = ({ classes }) => {
44+
return (
45+
<Grid container direction={'column'} >
46+
<Grid item className={classes.header} xs={12}>
47+
<Typography variant="h2" className={classes.headerText}>Sign up, it&apos;s <strong>free</strong>!</Typography>
48+
<div className={classes.description} >
49+
Faith makes it possible to achieve that which man&apos;s mind can conceive and believe.
50+
</div>
51+
</Grid>
52+
<Grid container direction={'column'} xs={12}>
53+
<Grid item className={classes.blocksMargin}>
54+
<FormGroup>
55+
<div className={classes.formLabels}>
56+
<FormLabel for="exampleInputEmail1">&nbsp; Email address</FormLabel>
57+
</div>
58+
<TextField
59+
id="exampleInputEmail1"
60+
type="email"
61+
placeholder="Enter email"
62+
margin="dense"
63+
variant="outlined"
64+
fullWidth
65+
/>
66+
</FormGroup>
67+
</Grid>
68+
<Grid item className={classes.blocksMargin}>
69+
<FormGroup>
70+
<div className={classes.formLabels}>
71+
<FormLabel for="pswd"><i /> &nbsp; Password</FormLabel>
72+
</div>
73+
<TextField
74+
id="pswd"
75+
type="text"
76+
placeholder="Min 8 characters"
77+
margin="dense"
78+
variant="outlined"
79+
fullWidth
80+
/>
81+
</FormGroup>
82+
</Grid>
83+
<Grid item>
84+
<Typography className={classes.blocksMargin}>
85+
To make a widget automatically load it's content you just need to set <strong>autoload</strong> attribute and provide an api to update the widget content.
86+
</Typography>
87+
<TextField
88+
id="outlined-read-only-input"
89+
defaultValue="<Widget updateWidgetData={this.updateWidgetData}/>"
90+
size="small"
91+
InputProps={{
92+
readOnly: true,
93+
}}
94+
variant="outlined"
95+
fullWidth
96+
margin="normal"
97+
>
98+
</TextField>
99+
100+
{/* <pre><code>&lt;Widget updateWidgetData={"{this.updateWidgetData}"} /&gt;</code></pre> */}
101+
<Typography className={classes.blocksMargin}>
102+
<strong>autoload</strong> may be set to an integer value. If set, for example, to 2000 will refresh widget every 2 seconds.
103+
</Typography>
104+
<div className={classes.buttonsGroup}>
105+
<Button
106+
variant="contained"
107+
>
108+
Cancel
109+
</Button>
110+
<Button
111+
className={classes.button}
112+
color="success"
113+
variant="contained"
114+
>
115+
&nbsp;Submit&nbsp;
116+
</Button>
117+
</div>
118+
119+
</Grid>
120+
</Grid>
121+
</Grid>
122+
)
123+
}
124+
125+
export default withStyles(styles)(AutoloadWidget);

0 commit comments

Comments
 (0)