-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e996bb
commit bdeb720
Showing
8 changed files
with
186 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
function ChartingError(props) { | ||
const { msg } = props; | ||
return ( | ||
<div className="charting-error-container"> | ||
<div className="charting-error-text"> | ||
{msg} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
ChartingError.propTypes = { | ||
msg: PropTypes.string, | ||
}; | ||
|
||
export default ChartingError; |
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,13 +1,21 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { connect } from 'react-redux'; | ||
import onClickFeedback from '../../modules/feedback/util'; | ||
import initFeedback from '../../modules/feedback/actions'; | ||
|
||
function ChartingInfo(props) { | ||
const { | ||
sendFeedback, | ||
feedbackIsInitiated, | ||
isMobile, | ||
} = props; | ||
return ( | ||
<div className="charting-info-container"> | ||
<div className="charting-info-text"> | ||
<p className="charting-info"> | ||
The charting feature is available for beta testing and evaluation. Please send comments and feedback to | ||
<a class="charting-feedback" href="mailto:[email protected]">[email protected]</a> | ||
. | ||
The charting feature is available for beta testing and evaluation. | ||
<span class="charting-feedback" onClick={() => sendFeedback(feedbackIsInitiated, isMobile)}>Please send comments and feedback to us.</span> | ||
</p> | ||
<p className="charting-info">The Charting Tool provides the option to create a line chart for a date range showing change over time, and statistics for a single date (minimum, maximum, mean, and standard deviation) for an area of interest.</p> | ||
|
||
|
@@ -28,5 +36,32 @@ function ChartingInfo(props) { | |
); | ||
} | ||
|
||
export default ChartingInfo; | ||
const mapStateToProps = (state) => { | ||
const { | ||
feedback, screenSize, | ||
} = state; | ||
return { | ||
feedbackIsInitiated: feedback.isInitiated, | ||
isMobile: screenSize.isMobileDevice, | ||
}; | ||
}; | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
sendFeedback: (isInitiated, isMobile) => { | ||
onClickFeedback(isInitiated, isMobile); | ||
if (!isInitiated) { | ||
dispatch(initFeedback()); | ||
} | ||
}, | ||
}); | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
)(ChartingInfo); | ||
|
||
ChartingInfo.propTypes = { | ||
feedbackIsInitiated: PropTypes.bool, | ||
sendFeedback: PropTypes.func, | ||
isMobile: PropTypes.bool, | ||
}; |
Oops, something went wrong.