2020-04-14 21:21:36 -07:00
|
|
|
import React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Helmet } from'react-helmet';
|
|
|
|
|
|
|
|
const mapStateToProps = state => ({
|
|
|
|
siteTitle: state.getIn(['instance', 'title']),
|
|
|
|
});
|
|
|
|
|
|
|
|
class SoapboxHelmet extends React.Component {
|
|
|
|
|
|
|
|
static propTypes = {
|
2020-04-21 10:04:00 -07:00
|
|
|
siteTitle: PropTypes.string,
|
2020-04-14 21:21:36 -07:00
|
|
|
children: PropTypes.node,
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { siteTitle, children } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Helmet
|
|
|
|
titleTemplate={`%s | ${siteTitle}`}
|
|
|
|
defaultTitle={siteTitle}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</Helmet>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(SoapboxHelmet);
|