From 7990c65c3309d0e722b699cdc9edb5fb60da6f03 Mon Sep 17 00:00:00 2001 From: OtacilioN Date: Thu, 9 May 2019 11:42:23 -0300 Subject: [PATCH 1/2] Add space-between to list elements and areaName areaName props displayed at header of ActionArea --- src/App.js | 10 ++++++++-- src/components/ActionArea.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index a291201..c5f90ef 100644 --- a/src/App.js +++ b/src/App.js @@ -18,7 +18,7 @@ function ListRender(props) { style={{ flexWrap: 'wrap', display: 'flex', - // justifyContent: 'space-between', + justifyContent: 'space-between', marginTop: 32 }} > @@ -62,7 +62,13 @@ export default class App extends React.Component { }} > - + {this.state.inFocus && (
- {this.props.areaName} + {this.props.areaName ? 'Área ' + this.props.areaName : null}
Date: Thu, 9 May 2019 11:48:03 -0300 Subject: [PATCH 2/2] Improve Area and Step components --- src/components/Area.js | 15 +++++++++++++-- src/components/StepBox.js | 26 +++++++++++++++----------- src/components/StepsLine.js | 12 ++++++++---- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/src/components/Area.js b/src/components/Area.js index 97b4c48..66b63ba 100644 --- a/src/components/Area.js +++ b/src/components/Area.js @@ -3,18 +3,29 @@ import Button from '@material-ui/core/Button'; export default class Area extends React.Component { render() { + const { id, cLevel } = this.props.poda; + + const getColorByCLevel = cLevel => { + if (cLevel === 'LOW') return '#56C577'; + if (cLevel === 'MEDIUM') return '#FF9C50'; + if (cLevel === 'HIGH') return '#FF6060'; + return '#56C577'; + }; + return ( ); } diff --git a/src/components/StepBox.js b/src/components/StepBox.js index 3820a08..ef9f6ef 100644 --- a/src/components/StepBox.js +++ b/src/components/StepBox.js @@ -2,12 +2,12 @@ import React from 'react'; export default class StepsBox extends React.Component { render() { - const { cLevel, status, shouldIDisplay } = this.props; + const { cLevel, status, shouldIDisplay, stepName } = this.props; const getColorByCLevel = cLevel => { - if (cLevel === 'LOW') return 'green'; - if (cLevel === 'MEDIUM') return 'yellow'; - if (cLevel === 'HIGH') return 'red'; - return 'lime'; + if (cLevel === 'LOW') return '#56C577'; + if (cLevel === 'MEDIUM') return '#FF9C50'; + if (cLevel === 'HIGH') return '#FF6060'; + return '#56C577'; }; const getStatusText = status => { if (status === 'DELAYED') return 'ATRASADO'; @@ -19,18 +19,22 @@ export default class StepsBox extends React.Component {
- {shouldIDisplay ? getStatusText(status) : null} + {stepName} + {/* {shouldIDisplay ? getStatusText(status) : null} */}
); } diff --git a/src/components/StepsLine.js b/src/components/StepsLine.js index fc6ab22..0eab5a1 100644 --- a/src/components/StepsLine.js +++ b/src/components/StepsLine.js @@ -14,22 +14,26 @@ export default class StepsLine extends React.Component { }} >