2022-01-10 14:17:52 -08:00
|
|
|
import { List as ImmutableList } from 'immutable';
|
2020-05-28 11:44:44 -07:00
|
|
|
import PropTypes from 'prop-types';
|
2022-01-10 14:17:52 -08:00
|
|
|
import React from 'react';
|
2020-05-28 11:44:44 -07:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2020-04-25 15:26:47 -07:00
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
2022-01-10 14:17:52 -08:00
|
|
|
import { connect } from 'react-redux';
|
2020-04-25 15:26:47 -07:00
|
|
|
import { Link } from 'react-router-dom';
|
2022-01-10 14:25:06 -08:00
|
|
|
|
2021-06-25 11:56:39 -07:00
|
|
|
import { getSettings } from 'soapbox/actions/settings';
|
2020-08-23 13:56:18 -07:00
|
|
|
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
|
2020-04-25 15:26:47 -07:00
|
|
|
|
2020-08-23 13:56:18 -07:00
|
|
|
const mapStateToProps = (state, props) => {
|
|
|
|
const soapboxConfig = getSoapboxConfig(state);
|
|
|
|
|
|
|
|
return {
|
|
|
|
copyright: soapboxConfig.get('copyright'),
|
|
|
|
navlinks: soapboxConfig.getIn(['navlinks', 'homeFooter'], ImmutableList()),
|
2021-06-25 11:56:39 -07:00
|
|
|
locale: getSettings(state).get('locale'),
|
2020-08-23 13:56:18 -07:00
|
|
|
};
|
|
|
|
};
|
2020-05-28 11:44:44 -07:00
|
|
|
|
|
|
|
export default @connect(mapStateToProps)
|
|
|
|
class Footer extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
copyright: PropTypes.string,
|
2021-06-25 12:01:10 -07:00
|
|
|
locale: PropTypes.string,
|
2020-05-28 11:44:44 -07:00
|
|
|
navlinks: ImmutablePropTypes.list,
|
|
|
|
}
|
2020-04-25 15:26:47 -07:00
|
|
|
|
|
|
|
render() {
|
2021-06-25 11:56:39 -07:00
|
|
|
const { copyright, locale, navlinks } = this.props;
|
2020-05-28 11:44:44 -07:00
|
|
|
|
2020-04-25 15:26:47 -07:00
|
|
|
return (
|
|
|
|
<div className='footer'>
|
|
|
|
<div className='footer-container'>
|
|
|
|
<div className='copyright'>
|
2020-05-28 11:44:44 -07:00
|
|
|
<span>{copyright}</span>
|
2020-04-25 15:26:47 -07:00
|
|
|
</div>
|
|
|
|
<ul>
|
2020-05-28 11:44:44 -07:00
|
|
|
{navlinks.map((link, i) => (
|
|
|
|
<li key={i}>
|
2021-06-25 12:01:10 -07:00
|
|
|
<Link to={link.get('url')}>
|
|
|
|
{link.getIn(['titleLocales', locale]) || link.get('title')}
|
|
|
|
</Link>
|
2020-05-28 11:44:44 -07:00
|
|
|
</li>
|
|
|
|
))}
|
2020-04-25 15:26:47 -07:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|