Skip to content

Commit

Permalink
Added Finish Button
Browse files Browse the repository at this point in the history
Drakota committed May 6, 2018
1 parent ed3eee1 commit ad1fdaa
Showing 9 changed files with 49 additions and 18 deletions.
Binary file added public/ego_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>eGOlogic</title>
</head>
<body>
<noscript>
Binary file added public/logo_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 12 additions & 7 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "eGOlogic",
"name": "eGOlogic",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
"src": "logo_bg.png",
"sizes": "144x144 64x64 32x32 24x24 16x16",
"type": "image/png"
},
{
"src": "ego_bg.png",
"sizes": "640x640",
"type": "image/png"
}
],
"start_url": "./index.html",
"start_url": "/",
"display": "standalone",
"theme_color": "#000000",
"theme_color": "#8dc63f",
"background_color": "#ffffff"
}
14 changes: 11 additions & 3 deletions src/components/DrawerComponent.js
Original file line number Diff line number Diff line change
@@ -28,7 +28,11 @@ class DrawerComponent extends Component {
<div className={"handle"}></div>
<img className={"current-image"} src={this.props.current_activity.info.image} />
<span className={"current-address"}>{this.props.current_activity.info.address}</span>
<Button type="primary" onClick={this.props.readyRally} className={"current-next-button"}>Next</Button>
{this.props.finishButton() ? (
<Button type="primary" onClick={this.props.readyRally} className={"current-next-button"}>Finish</Button>
) : (
<Button type="primary" onClick={this.props.readyRally} className={"current-next-button"}>Next</Button>
)}
</div>
);
}
@@ -76,10 +80,14 @@ class DrawerComponent extends Component {
<div className={"handle-drawer"}></div>
<img className={"current-image-drawer"} src={this.props.current_activity.info.image} />
<span className={"current-address-drawer"}>{this.props.current_activity.info.address}</span>
<Alert className={"alert-drawer"} message="Tip:" description={_.sample(GoodActions.data)} type="info" showIcon />
<Alert className={"alert-drawer"} message="Tip:" description={_.sample(GoodActions.data)} type="info" />
<Progress className={"progress-drawer"} type="circle" percent={this.props.progress} />
<Button type="danger" onClick={this.props.cancelRally} className={"current-next-button-drawer"}>Cancel</Button>
<Button type="primary" onClick={this.props.readyRally} className={"current-next-button-drawer"}>Next</Button>
{this.props.finishButton() ? (
<Button type="primary" onClick={this.props.readyRally} className={"current-next-button-drawer"}>Finish</Button>
) : (
<Button type="primary" onClick={this.props.readyRally} className={"current-next-button-drawer"}>Next</Button>
)}
</Drawer>
)}
</Fragment>
5 changes: 3 additions & 2 deletions src/components/Feedback.js
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ class Feedback extends React.Component {
visible={visible}
title="Feedback"
onOk={this.props.handleOk}
className={"modal-feedback"}
onCancel={this.props.handleCancel}
footer={[
<Button key="back" onClick={this.props.handleCancel}>Return</Button>,
@@ -37,7 +38,7 @@ class Feedback extends React.Component {
<p>How satisfied were you with the furniture in this location?</p>
<RadioGroup value={this.props.furnitureChoice} onChange={this.props.onChangeFurniture} defaultValue="a">
<RadioButton value="Very Satified">Very Satisfied</RadioButton>
<RadioButton value="Statisfied">Statisfied</RadioButton>
<RadioButton value="Statisfied">Satisfied</RadioButton>
<RadioButton value="Unsatisfied">Unsatisfied</RadioButton>
</RadioGroup>
</div>
@@ -46,7 +47,7 @@ class Feedback extends React.Component {
<p>How satisfied were you with the maintenance of this location?</p>
<RadioGroup value={this.props.maintenanceChoice} onChange={this.props.onChangeMaintenance} defaultValue="a">
<RadioButton value="Very Satified">Very Satisfied</RadioButton>
<RadioButton value="Statisfied">Statisfied</RadioButton>
<RadioButton value="Statisfied">Satisfied</RadioButton>
<RadioButton value="Unsatisfied">Unsatisfied</RadioButton>
</RadioGroup>
</div>
14 changes: 13 additions & 1 deletion src/containers/DrawerContainer.js
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ class DrawerContainer extends Component {

calculatePercentage = () => {
const current_activity = this.props.current_activity;
if (this.props.activities) {
if (this.props.activities) {
var index = this.props.activities.findIndex(function(activity) {
return _.isEqual(activity, current_activity);
});
@@ -96,6 +96,17 @@ class DrawerContainer extends Component {
}
}

finishButton = () => {
const current_activity = this.props.current_activity;
if (this.props.current_activity) {
var index = this.props.activities.findIndex(function(activity) {
return _.isEqual(activity, current_activity);
});
return index + 1 === 5;
}
return false;
}

render() {
return (
<DrawerComponent
@@ -112,6 +123,7 @@ class DrawerContainer extends Component {
progress={this.state.progress}
reviewLocation={this.toggleReview}
locationReviewed={this.props.locationReviewed}
finishButton={this.finishButton}
/>
);
}
13 changes: 9 additions & 4 deletions src/styles/App.css
Original file line number Diff line number Diff line change
@@ -240,9 +240,9 @@ body {
}

.current-next-button {
float: right;
margin-top: 7px;
margin-right: 2px;
position: absolute;
bottom: 13px;
right: 10px;
height: 50px;
}

@@ -295,10 +295,11 @@ body {
.alert-drawer {
float: left;
margin: 10px;
max-width: 52%;
max-width: calc(100% - 180px);
max-height: 52%;
word-break: break-word;
}

.leaderboardDiv {
text-align: center;
border-bottom: black 1px solid;
@@ -318,3 +319,7 @@ body {
color: rgba(0, 0, 0, 0.65);
text-decoration: none;
}

.modal-feedback {

}

0 comments on commit ad1fdaa

Please sign in to comment.