forked from stadtnavi/digitransit-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/next' into next
- Loading branch information
Showing
3 changed files
with
101 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import PropTypes from 'prop-types'; | ||
/* eslint-disable react/no-array-index-key */ | ||
import React from 'react'; | ||
import Link from 'found/Link'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import connectToStores from 'fluxible-addons-react/connectToStores'; | ||
|
||
const FeedbackPage = ({ currentLanguage }, { config }) => { | ||
const feedback = config.feedback[currentLanguage]; | ||
return ( | ||
<div className="about-page fullscreen"> | ||
<div className="page-frame fullscreen momentum-scroll"> | ||
{feedback.map((section, i) => | ||
(section.paragraphs && section.paragraphs.length) || section.link ? ( | ||
<div key={`feedback-section-${i}`}> | ||
{i === 0 ? ( | ||
<h1 className="feedback-header">{section.header}</h1> | ||
) : ( | ||
<h2 className="feedback-header">{section.header}</h2> | ||
)} | ||
{section.paragraphs && | ||
section.paragraphs.map((p, j) => ( | ||
// eslint-disable-next-line react/no-danger | ||
<p | ||
dangerouslySetInnerHTML={{ __html: p }} | ||
key={`feedback-section-${i}-p-${j}`} | ||
/> | ||
))} | ||
{section.link && ( | ||
<a href={section.link} className="link"> | ||
<FormattedMessage | ||
id="extra-info" | ||
defaultMessage="More information" | ||
/> | ||
</a> | ||
)} | ||
</div> | ||
) : ( | ||
false | ||
), | ||
)} | ||
<Link to="/"> | ||
<div className="call-to-action-button"> | ||
<FormattedMessage | ||
id="back-to-front-page" | ||
defaultMessage="Back to front page" | ||
/> | ||
</div> | ||
</Link> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
FeedbackPage.propTypes = { | ||
currentLanguage: PropTypes.string.isRequired, | ||
}; | ||
|
||
FeedbackPage.contextTypes = { | ||
config: PropTypes.object.isRequired, | ||
}; | ||
|
||
const connectedComponent = connectToStores( | ||
FeedbackPage, | ||
['PreferencesStore'], | ||
context => ({ | ||
currentLanguage: context.getStore('PreferencesStore').getLanguage(), | ||
}), | ||
); | ||
|
||
export { connectedComponent as default, FeedbackPage as Component }; |
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