Unverified Commit b28e24cc authored by andreswebs's avatar andreswebs
Browse files

fix broken cashIn methods

parent eb726535
...@@ -27,6 +27,9 @@ import pagesHeaderStyle from 'assets/jss/material-dashboard-react/components/pag ...@@ -27,6 +27,9 @@ import pagesHeaderStyle from 'assets/jss/material-dashboard-react/components/pag
import { getKey } from 'utils'; import { getKey } from 'utils';
// TODO: fix
/* eslint-disable react/no-array-index-key, react/no-did-update-set-state */
class PagesHeader extends React.Component { class PagesHeader extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -35,8 +38,7 @@ class PagesHeader extends React.Component { ...@@ -35,8 +38,7 @@ class PagesHeader extends React.Component {
}; };
} }
// TODO: fix componentDidUpdate(e) {
UNSAFE_componentWillMount(e) {
if (e.history.location.pathname !== e.location.pathname) { if (e.history.location.pathname !== e.location.pathname) {
this.setState({ open: false }); this.setState({ open: false });
} }
...@@ -70,9 +72,7 @@ class PagesHeader extends React.Component { ...@@ -70,9 +72,7 @@ class PagesHeader extends React.Component {
/> />
</NavLink> </NavLink>
</ListItem> </ListItem>
{pagesRoutes.map(prop => { {pagesRoutes.map((prop, key) => {
const key = getKey(prop);
if (prop.redirect) { if (prop.redirect) {
return null; return null;
} }
......
...@@ -26,6 +26,9 @@ import Button from 'components/CustomButtons/Button'; ...@@ -26,6 +26,9 @@ import Button from 'components/CustomButtons/Button';
import authNavbarStyle from 'assets/jss/material-dashboard-react/components/authNavbarStyle'; import authNavbarStyle from 'assets/jss/material-dashboard-react/components/authNavbarStyle';
// TODO: fix
/* eslint-disable react/no-did-update-set-state */
class AuthNavbar extends React.Component { class AuthNavbar extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -34,8 +37,7 @@ class AuthNavbar extends React.Component { ...@@ -34,8 +37,7 @@ class AuthNavbar extends React.Component {
}; };
} }
// TODO: fix componentDidUpdate(e) {
UNSAFE_componentWillMount(e) {
if (e.history.location.pathname !== e.location.pathname) { if (e.history.location.pathname !== e.location.pathname) {
this.setState({ open: false }); this.setState({ open: false });
} }
......
...@@ -12,7 +12,8 @@ import TableRow from '@material-ui/core/TableRow'; ...@@ -12,7 +12,8 @@ import TableRow from '@material-ui/core/TableRow';
import tableStyle from 'assets/jss/material-dashboard-react/components/tableStyle'; import tableStyle from 'assets/jss/material-dashboard-react/components/tableStyle';
import { getKey } from 'utils'; // TODO: fix
/* eslint-disable react/no-array-index-key */
function CustomTable({ ...props }) { function CustomTable({ ...props }) {
const { const {
...@@ -36,9 +37,7 @@ function CustomTable({ ...props }) { ...@@ -36,9 +37,7 @@ function CustomTable({ ...props }) {
{tableHead !== undefined ? ( {tableHead !== undefined ? (
<TableHead className={classes[tableHeaderColor]}> <TableHead className={classes[tableHeaderColor]}>
<TableRow className={classes.tableRow}> <TableRow className={classes.tableRow}>
{tableHead.map(prop => { {tableHead.map((prop, key) => {
const key = getKey(prop);
const tableCellClasses = `${classes.tableHeadCell} ${ const tableCellClasses = `${classes.tableHeadCell} ${
classes.tableCell classes.tableCell
} ${cx({ } ${cx({
...@@ -58,9 +57,7 @@ function CustomTable({ ...props }) { ...@@ -58,9 +57,7 @@ function CustomTable({ ...props }) {
</TableHead> </TableHead>
) : null} ) : null}
<TableBody> <TableBody>
{tableData.map(prop => { {tableData.map((prop, key) => {
const key = getKey(prop);
let rowColor = ''; let rowColor = '';
let rowColored = false; let rowColored = false;
if (prop.color !== undefined) { if (prop.color !== undefined) {
...@@ -121,9 +118,7 @@ function CustomTable({ ...props }) { ...@@ -121,9 +118,7 @@ function CustomTable({ ...props }) {
hover={hover} hover={hover}
className={`${classes.tableRow} ${tableRowClasses}`} className={`${classes.tableRow} ${tableRowClasses}`}
> >
{prop.map(prop => { {prop.map((prop, key) => {
const key = getKey(prop);
const tableCellClasses = `${classes.tableCell} ${cx({ const tableCellClasses = `${classes.tableCell} ${cx({
[classes[colorsColls[coloredColls.indexOf(key)]]]: [classes[colorsColls[coloredColls.indexOf(key)]]]:
coloredColls.indexOf(key) !== -1, coloredColls.indexOf(key) !== -1,
......
...@@ -10,11 +10,9 @@ import Card from 'components/Card/Card'; ...@@ -10,11 +10,9 @@ import Card from 'components/Card/Card';
import wizardStyle from 'assets/jss/material-dashboard-react/components/wizardStyle'; import wizardStyle from 'assets/jss/material-dashboard-react/components/wizardStyle';
import { getKey } from 'utils';
// TODO: fix // TODO: fix
/* eslint-disable react/no-string-refs, react/no-unused-prop-types, react/no-unused-state */ /* eslint-disable react/no-array-index-key, react/no-string-refs, react/no-unused-prop-types, react/no-unused-state */
class Wizard extends React.Component { class Wizard extends React.Component {
constructor(props) { constructor(props) {
...@@ -254,9 +252,7 @@ class Wizard extends React.Component { ...@@ -254,9 +252,7 @@ class Wizard extends React.Component {
</div> </div>
<div className={classes.wizardNavigation}> <div className={classes.wizardNavigation}>
<ul className={classes.nav}> <ul className={classes.nav}>
{steps.map((prop, i) => { {steps.map((prop, key) => {
const key = getKey(prop);
return ( return (
<li <li
className={classes.steps} className={classes.steps}
...@@ -268,7 +264,7 @@ class Wizard extends React.Component { ...@@ -268,7 +264,7 @@ class Wizard extends React.Component {
className={classes.stepsAnchor} className={classes.stepsAnchor}
onClick={e => { onClick={e => {
e.preventDefault(); e.preventDefault();
this.navigationStepChange(i); this.navigationStepChange(key);
}} }}
> >
{prop.stepName} {prop.stepName}
...@@ -285,11 +281,10 @@ class Wizard extends React.Component { ...@@ -285,11 +281,10 @@ class Wizard extends React.Component {
</div> </div>
</div> </div>
<div className={classes.content}> <div className={classes.content}>
{steps.map((prop, i) => { {steps.map((prop, key) => {
const key = getKey(prop);
const stepContentClasses = cx({ const stepContentClasses = cx({
[classes.stepContentActive]: this.state.currentStep === i, [classes.stepContentActive]: this.state.currentStep === key,
[classes.stepContent]: this.state.currentStep !== i [classes.stepContent]: this.state.currentStep !== key
}); });
return ( return (
<div className={stepContentClasses} key={key}> <div className={stepContentClasses} key={key}>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment