-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:haxaco/c4v-team1
- Loading branch information
Showing
10 changed files
with
157 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './mapAction'; | ||
export * from './mapAction'; | ||
export * from './reportAction'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import axios from 'axios' | ||
|
||
export const postReport = (info) => async dispatch => { | ||
console.log(info) | ||
// axios.post('/') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
import React, {Component} from 'react'; | ||
import React, { Component } from "react"; | ||
import ReportAction from "./ReportPanel"; | ||
|
||
class PanelAction extends Component { | ||
render() { | ||
return ( | ||
<div className="panel-action"> | ||
<div className="panel-action__wrapper"> | ||
<button className="btn action-btn">Report</button> | ||
<button className="btn action-btn">See all incident</button> | ||
</div> | ||
</div> | ||
) | ||
state = { | ||
showReport: false, | ||
} | ||
|
||
|
||
closeReport = () => { | ||
this.setState({showReport: false}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<React.Fragment> | ||
{this.state.showReport && <ReportAction closeReport={this.closeReport} />} | ||
<div className="panel-action"> | ||
<div className="panel-action__wrapper"> | ||
<button className="btn action-btn" onClick={() => this.setState({showReport: true})}>Report</button> | ||
<button className="btn action-btn">See all incident</button> | ||
</div> | ||
</div> | ||
</React.Fragment> | ||
); | ||
} | ||
} | ||
|
||
export default PanelAction; | ||
export default PanelAction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React, { Component } from "react"; | ||
import { postReport } from "../../actions"; | ||
import { connect } from "react-redux"; | ||
import { GoogleComponent } from "react-google-location"; | ||
const API_KEY = "AIzaSyCvdgUHoWt0MgqmWmcw-IcMAXMvRLWxcpE"; | ||
|
||
class ReportAction extends Component { | ||
state = { | ||
location: "", | ||
cat: "" | ||
}; | ||
handleSubmit = e => { | ||
e.preventDefault(); | ||
const { location, cat } = this.state; | ||
this.props.postReport({ location, cat }); | ||
}; | ||
render() { | ||
console.log(this.state.location); | ||
return ( | ||
<div className="report-panel"> | ||
<div className="fade" onClick={() => this.props.closeReport()} /> | ||
<div className="report-panel__wrapper"> | ||
<form onSubmit={e => this.handleSubmit(e)}> | ||
<GoogleComponent | ||
apiKey={API_KEY} | ||
language={"en"} | ||
// country={"country:in|country:ve"} | ||
coordinates={true} | ||
// locationBoxStyle={"custom-style"} | ||
// locationListStyle={"custom-style-list"} | ||
onChange={e => this.setState({ location: e.target })} | ||
></GoogleComponent> | ||
{/* <input type="text" placeholder="Address" onChange={e => this.setState({location: e.target.value })}/> */} | ||
<input | ||
type="type" | ||
placeholder="Category" | ||
onChange={e => this.setState({ cat: e.target.value })} | ||
/> | ||
<button type="submit">Submit</button> | ||
</form> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default connect( | ||
null, | ||
{ postReport } | ||
)(ReportAction); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.report-panel { | ||
width: 100vw; | ||
height: 100vh; | ||
position: fixed; | ||
z-index: 9999; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
.fade { | ||
background: rgba(0, 0, 0, .7); | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
cursor: pointer; | ||
} | ||
|
||
&__wrapper { | ||
background: black; | ||
width: 400px; | ||
height: 400px; | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
position: relative; | ||
|
||
input { | ||
width: 100%; | ||
padding: 10px; | ||
border: 0; | ||
border-radius: 20px; | ||
margin-top: 10px; | ||
} | ||
|
||
} | ||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters