Skip to content

Commit fbae985

Browse files
Update profile page stepper, update users table styles
1 parent ef33bd8 commit fbae985

File tree

9 files changed

+134
-192
lines changed

9 files changed

+134
-192
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"axios-mock-adapter": "^1.19.0",
3131
"bootstrap": "^4.6.0",
3232
"classnames": "^2.2.6",
33+
"clsx": "^1.1.1",
3334
"connected-react-router": "^6.9.1",
3435
"cross-env": "^7.0.3",
3536
"eva-icons": "^1.1.3",
@@ -56,7 +57,6 @@
5657
"react-bootstrap-table": "^4.3.1",
5758
"react-bootstrap-table-next": "^4.0.3",
5859
"react-bootstrap-table2-paginator": "^2.1.2",
59-
"react-chrono": "^1.10.1",
6060
"react-datepicker": "^4.1.1",
6161
"react-dom": "^17.0.1",
6262
"react-dropzone": "^11.3.2",

src/actions/auth.js

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -230,56 +230,3 @@ export function registerUser(creds) {
230230
}
231231

232232

233-
234-
235-
236-
// export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
237-
// export const LOGIN_FAILURE = 'LOGIN_FAILURE';
238-
// export const LOGOUT_REQUEST = 'LOGOUT_REQUEST';
239-
// export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
240-
//
241-
// export function receiveLogin() {
242-
// return {
243-
// type: LOGIN_SUCCESS
244-
// };
245-
// }
246-
//
247-
// function loginError(payload) {
248-
// return {
249-
// type: LOGIN_FAILURE,
250-
// payload,
251-
// };
252-
// }
253-
//
254-
// function requestLogout() {
255-
// return {
256-
// type: LOGOUT_REQUEST,
257-
// };
258-
// }
259-
//
260-
// export function receiveLogout() {
261-
// return {
262-
// type: LOGOUT_SUCCESS,
263-
// };
264-
// }
265-
//
266-
// // logs the user out
267-
// export function logoutUser() {
268-
// return (dispatch) => {
269-
// dispatch(requestLogout());
270-
// localStorage.removeItem('authenticated');
271-
// dispatch(receiveLogout());
272-
// };
273-
// }
274-
//
275-
// export function loginUser(creds) {
276-
// return (dispatch) => {
277-
// dispatch(receiveLogin());
278-
// if (creds.email.length > 0 && creds.password.length > 0) {
279-
// localStorage.setItem('authenticated', true)
280-
// } else {
281-
// dispatch(loginError('Something was wrong. Try again'));
282-
// }
283-
// }
284-
// }
285-

src/components/Users/list/UsersListTable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
Modal,
1414
ModalHeader,
1515
ModalBody,
16-
ModalFooter,
16+
ModalFooter, ButtonDropdown,
1717
} from 'reactstrap';
1818

1919
import {
@@ -89,14 +89,14 @@ class UsersListTable extends Component {
8989
});
9090

9191
return (
92-
<Dropdown isOpen={props.open} toggle={props.toggleDropDown}>
93-
<DropdownToggle color="default" caret>
92+
<ButtonDropdown isOpen={props.open} toggle={props.toggleDropDown}>
93+
<DropdownToggle caret>
9494
{ props.currSizePerPage }
9595
</DropdownToggle>
9696
<DropdownMenu>
9797
{ limits }
9898
</DropdownMenu>
99-
</Dropdown>
99+
</ButtonDropdown>
100100
);
101101
};
102102

src/pages/auth/register/Register.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ class Register extends React.Component {
6262
}
6363

6464
render() {
65-
// const { from } = this.props.location.state || { from: { pathname: '/template' } };
66-
//
67-
// if (Login.isAuthenticated(JSON.parse(localStorage.getItem('authenticated')))) {
68-
// return (
69-
// <Redirect to={from} />
70-
// );
71-
// }
65+
const { from } = this.props.location.state || { from: { pathname: '/template' } };
66+
if (!window.location.href.includes('extra')) {
67+
if (Login.isAuthenticated()) {
68+
return (
69+
<Redirect to={from} />
70+
);
71+
}
72+
}
73+
7274

7375
return (
7476
<div className="auth-page">

src/pages/profile/Profile.js

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99
DropdownMenu,
1010
DropdownItem, Dropdown,
1111
} from "reactstrap";
12-
import { Chrono } from "react-chrono";
1312
import Widget from "../../components/Widget/Widget";
13+
import TasksStepper from "./stepper/TasksStepper";
1414
import AvatarGroup from "../../components/AvatarGroup/AvatarGroup";
1515
import ApexCharts from "react-apexcharts";
1616
import s from "./Profile.module.scss";
@@ -129,11 +129,6 @@ export default function Profile() {
129129
</Widget>
130130
</Col>
131131
</Row>
132-
133-
134-
135-
136-
137132
<Row>
138133
<Col lg={6} sm={12}>
139134
<Row className={s.widgetRow}>
@@ -155,21 +150,7 @@ export default function Profile() {
155150
</ButtonDropdown>
156151
</div>
157152
<div className={s.chronoWidget}>
158-
<Chrono
159-
items={timelineWidget.timelineSteps}
160-
mode="VERTICAL"
161-
hideControls
162-
>
163-
{timelineWidget.timelineData.map((item, index) => (
164-
<div key={index} className="d-flex flex-row align-self-baseline ml-3">
165-
<img src={item.img} alt="item pic"/>
166-
<div className="d-flex flex-column ml-3">
167-
<p className="body-2">{item.title}</p>
168-
<p className="body-3 muted">{item.label}</p>
169-
</div>
170-
</div>
171-
))}
172-
</Chrono>
153+
<TasksStepper/>
173154
</div>
174155
</Widget>
175156
</Col>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import React from "react";
2+
import { makeStyles, withStyles } from "@material-ui/core/styles";
3+
import Stepper from '@material-ui/core/Stepper';
4+
import Step from '@material-ui/core/Step';
5+
import StepLabel from '@material-ui/core/StepLabel';
6+
import StepConnector from '@material-ui/core/StepConnector';
7+
import clsx from 'clsx';
8+
import mock from "../mock";
9+
10+
const useStyles = makeStyles((theme) => ({
11+
root: {
12+
width: '100%',
13+
},
14+
iconContainer: {
15+
'& svg': {
16+
width: 32,
17+
height: 32,
18+
},
19+
},
20+
}));
21+
22+
const stepsData = mock.timelineWidget.timelineData;
23+
24+
const ColorlibConnector = withStyles({
25+
active: {
26+
'& $line': {
27+
backgroundColor: '#4D53E0',
28+
},
29+
},
30+
completed: {
31+
'& $line': {
32+
backgroundColor: '#4D53E0',
33+
},
34+
},
35+
line: {
36+
border: 0,
37+
width: 3,
38+
backgroundColor: '#4D53E0',
39+
borderRadius: 0,
40+
},
41+
vertical: {
42+
padding: 0,
43+
marginLeft: 14,
44+
marginTop: -8,
45+
marginBottom: -8,
46+
'& span': {
47+
minHeight: 40,
48+
}
49+
}
50+
})(StepConnector);
51+
52+
export default function TasksStepper() {
53+
const classes = useStyles();
54+
const [activeStep, setActiveStep] = React.useState(3);
55+
56+
const handleClick = (e) => {
57+
setActiveStep(e)
58+
}
59+
60+
return (
61+
<div className={classes.root}>
62+
63+
<Stepper activeStep={activeStep} orientation="vertical" connector={<ColorlibConnector />}>
64+
{stepsData.map((item, index) => (
65+
66+
<Step key={index} onClick={() => handleClick(index)}>
67+
<StepLabel className={classes.iconContainer}>
68+
<div key={index} className="d-flex flex-row align-self-baseline ml-3">
69+
<img src={item.img} alt="item pic"/>
70+
<div className="d-flex flex-column ml-3">
71+
<p className="body-2">{item.title}</p>
72+
<p className="body-3 muted">{item.label}</p>
73+
</div>
74+
</div>
75+
</StepLabel>
76+
</Step>
77+
78+
))}
79+
</Stepper>
80+
81+
</div>
82+
)
83+
}
84+
85+
86+
// <Stepper alternativeLabel activeStep={activeStep} connector={<ColorlibConnector />}>
87+
// {steps.map((label) => (
88+
// <Step key={label}>
89+
// <StepLabel StepIconComponent={ColorlibStepIcon}>{label}</StepLabel>
90+
// </Step>
91+
// ))}
92+
// </Stepper>
93+

src/pages/tables/Tables.js

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -228,26 +228,26 @@ const Tables = function () {
228228
(secondTableCurrentPage + 1) * pageSize
229229
)
230230
.map(item => (
231-
<tr key={uuidv4()}>
232-
<td>
233-
<div className="checkbox checkbox-primary">
234-
<input
235-
id={item.id}
236-
className="styled"
237-
type="checkbox"
238-
/>
239-
<label for={item.id} />
240-
</div>
241-
</td>
242-
<td>{item.name}</td>
243-
<td>{item.email}</td>
244-
<td>{item.product}</td>
245-
<td>{item.price}</td>
246-
<td>{item.date}</td>
247-
<td>{item.city}</td>
248-
<td><Badge color={item.color}>{item.status}</Badge></td>
249-
</tr>
250-
))}
231+
<tr key={uuidv4()}>
232+
<td>
233+
<div className="checkbox checkbox-primary">
234+
<input
235+
id={item.id}
236+
className="styled"
237+
type="checkbox"
238+
/>
239+
<label for={item.id} />
240+
</div>
241+
</td>
242+
<td>{item.name}</td>
243+
<td>{item.email}</td>
244+
<td>{item.product}</td>
245+
<td>{item.price}</td>
246+
<td>{item.date}</td>
247+
<td>{item.city}</td>
248+
<td><Badge color={item.color}>{item.status}</Badge></td>
249+
</tr>
250+
))}
251251
</tbody>
252252
</Table>
253253
<Pagination className="pagination-with-border">
@@ -297,7 +297,6 @@ const Tables = function () {
297297
<DropdownItem>Monthly</DropdownItem>
298298
</DropdownMenu>
299299
</ButtonDropdown>
300-
{/*<img src="" alt="Filter option"/>*/}
301300
</div>
302301
</div>
303302
<div className={s.widgetContentBlock}>

src/styles/_overrides.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,12 +1713,6 @@ li.react-datepicker__time-list-item--selected {
17131713
font-size: 16px;
17141714
}
17151715

1716-
.react-bs-table .react-bs-container-footer > table > thead > tr > th, .react-bs-table .react-bs-container-header > table > thead > tr > th {
1717-
border: none;
1718-
background: $default;
1719-
color: $white;
1720-
}
1721-
17221716
.table {
17231717
margin-bottom: 0;
17241718
}

0 commit comments

Comments
 (0)