-
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.
added organization and hooked up the feedback.
- Loading branch information
Showing
12 changed files
with
237 additions
and
48 deletions.
There are no files selected for viewing
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,51 +1,76 @@ | ||
import React from 'react' | ||
import React, {Component } from 'react' | ||
import { connect } from 'react-redux' | ||
import {postFeedback} from '../actions' | ||
//import PropTypes from 'prop-types' | ||
|
||
var Feedbackfield = ({selected, onClick}) => ( | ||
<div > | ||
|
||
<div id="feedback"> | ||
<a onClick={activateLasers}> | ||
Tell us something... | ||
</a> | ||
</div> | ||
|
||
<div id="feedbackoverlay"> | ||
<div id="feedbackform"> | ||
<div id="closeform"> | ||
<a onClick={deactivateLasers} id="closeform">X</a> | ||
</div> | ||
<form> | ||
Tell us something... | ||
<br></br> | ||
<textarea | ||
rows="4" cols="50"> | ||
</textarea> | ||
<br></br> | ||
<input type="submit" value="Submit"> | ||
</input> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
|
||
Feedbackfield.propTypes = { | ||
// onClick: PropTypes.func.isRequired, | ||
} | ||
|
||
export default Feedbackfield | ||
|
||
function activateLasers(){ | ||
class Feedbackfield extends Component { | ||
activateLasers = () => { | ||
var feedbackoverlay=document.getElementById("feedbackoverlay"); | ||
feedbackoverlay.style.display = 'inline'; | ||
return; | ||
} | ||
} | ||
|
||
function deactivateLasers(){ | ||
deactivateLasers = () => { | ||
var feedbackoverlay=document.getElementById("feedbackoverlay"); | ||
feedbackoverlay.style.display = 'none'; | ||
return; | ||
} | ||
|
||
submitFeedback = (e) => { | ||
e.preventDefault(); | ||
var m = document.getElementById("message") | ||
this.props.postFeedback(m.value) | ||
m.value = "" | ||
this.deactivateLasers() | ||
} | ||
|
||
render() { | ||
return ( | ||
<div > | ||
<div id="feedback"> | ||
<a onClick={this.activateLasers}> | ||
Tell us something... | ||
</a> | ||
</div> | ||
|
||
<div id="feedbackoverlay"> | ||
<div id="feedbackform"> | ||
<div id="closeform"> | ||
<a onClick={this.deactivateLasers} id="closeform"><span>×</span></a> | ||
</div> | ||
<form className="form"> | ||
Tell us something... | ||
<br></br> | ||
<textarea id="message" rows="4" cols="50"/> | ||
<br/> | ||
<button onClick={(e) => this.submitFeedback(e)} className="btn btn-primary" >Submit</button> | ||
<br/> | ||
<div> | ||
<br /> | ||
<small>Your feedback will be sent to our private <a href="https://ciscospark.com">spark</a> room. | ||
<br/> | ||
Please include contact information if you want us to respond to you.</small> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
)} | ||
} | ||
|
||
const mapStateToProps = (state, ownProps) => ({ | ||
feedback: state.kubam.feedback, | ||
}) | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
postFeedback: (feedback) => dispatch(postFeedback(feedback)) | ||
}) | ||
|
||
|
||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps)(Feedbackfield) | ||
|
||
|
||
|
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { | ||
POST_FEEDBACK, | ||
POSTED_FEEDBACK, | ||
} from '../actions' | ||
|
||
const kubam = (state = { | ||
feedback: "", | ||
}, action) => { | ||
switch (action.type) { | ||
case POST_FEEDBACK: | ||
return Object.assign({}, state, { | ||
feedback: action.feedback, | ||
}) | ||
case POSTED_FEEDBACK: | ||
return Object.assign({}, state, { | ||
feedback: "", | ||
}) | ||
default: | ||
return state | ||
} | ||
} | ||
export default kubam |
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
Oops, something went wrong.