@@ -2,12 +2,15 @@ const FormattedMessage = require('react-intl').FormattedMessage;
22const injectIntl = require ( 'react-intl' ) . injectIntl ;
33const intlShape = require ( 'react-intl' ) . intlShape ;
44const MediaQuery = require ( 'react-responsive' ) . default ;
5+ const connect = require ( 'react-redux' ) . connect ;
6+ const PropTypes = require ( 'prop-types' ) ;
57const React = require ( 'react' ) ;
68
79const FooterBox = require ( '../container/footer.jsx' ) ;
810const LanguageChooser = require ( '../../languagechooser/languagechooser.jsx' ) ;
911
1012const frameless = require ( '../../../lib/frameless' ) ;
13+ const getScratchWikiLink = require ( '../../../lib/scratch-wiki' ) ;
1114
1215require ( './footer.scss' ) ;
1316
@@ -108,7 +111,7 @@ const Footer = props => (
108111 </ a >
109112 </ dd >
110113 < dd >
111- < a href = "https://en.scratch-wiki.info/" >
114+ < a href = { props . scratchWikiLink } >
112115 < FormattedMessage id = "general.wiki" />
113116 </ a >
114117 </ dd >
@@ -213,7 +216,13 @@ const Footer = props => (
213216) ;
214217
215218Footer . propTypes = {
216- intl : intlShape . isRequired
219+ intl : intlShape . isRequired ,
220+ scratchWikiLink : PropTypes . string
217221} ;
218222
219- module . exports = injectIntl ( Footer ) ;
223+ const mapStateToProps = ( state , ownProps ) => ( {
224+ scratchWikiLink : getScratchWikiLink ( ownProps . intl . locale )
225+ } ) ;
226+
227+ const ConnectedFooter = connect ( mapStateToProps ) ( Footer ) ;
228+ module . exports = injectIntl ( ConnectedFooter ) ;
0 commit comments