Skip to content

Commit

Permalink
Merge pull request #97 from marleymarl/mapdatatableCleanup
Browse files Browse the repository at this point in the history
created displayDirectionsAndDateSearch function and set to false in M…
  • Loading branch information
marleymarl authored Apr 29, 2020
2 parents ccdae17 + d7a874a commit 3a4d26c
Showing 1 changed file with 42 additions and 9 deletions.
51 changes: 42 additions & 9 deletions src/MapContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export class MapContainer extends Component {
centerLat: props.initialLat,
centerLon: props.initialLon,
showCheckPositions: false,
showCheckDirections: false,
showSaveToCSV: false,
showInstructions: false

};

this.postData = this.postData.bind(this);
Expand Down Expand Up @@ -278,6 +282,41 @@ export class MapContainer extends Component {
});
}

displayDirectionsAndDateSearch = () => {
if (this.state.showCheckDirections === true) {
return (
<>
<Collapse>
<Panel key="2" header="Direction Search">
<DirectionSearch></DirectionSearch>
</Panel>
<Panel key="3" header="Date range Search">
<DaterangeSearch></DaterangeSearch>
</Panel>
</Collapse>
</>

)
} else {

}
}

// displayCSVSave = () => {
// if (this.state.showSaveToCSV === true) {
// return (
// <>
// <CSVLink data={dataSource} className="download-csv">
// <Button type="primary">Save to CSV</Button>
// </CSVLink>
// </>

// )
// } else {

// }
// }

checkAgainstConfirmed = () => {
this.setState(
Object.assign({}, this.state, {
Expand Down Expand Up @@ -413,13 +452,9 @@ export class MapContainer extends Component {

</ol>
</Panel>
<Panel key="2" header="Direction Search">
<DirectionSearch></DirectionSearch>
</Panel>
<Panel key="3" header="Date range Search">
<DaterangeSearch></DaterangeSearch>
</Panel>

</Collapse>
{this.displayDirectionsAndDateSearch()}

<Table
dataSource={dataSource}
Expand All @@ -429,9 +464,7 @@ export class MapContainer extends Component {
size="small"
/>

<CSVLink data={dataSource} className="download-csv">
<Button type="primary">Save to CSV</Button>
</CSVLink>

<div>
<button className="save-button" onClick={this.postData}>
{this.showWhatButtonText()}
Expand Down

0 comments on commit 3a4d26c

Please sign in to comment.