Make home footer navlinks customizable #108
This commit is contained in:
parent
a9eb5c1765
commit
575a8889c1
2 changed files with 35 additions and 8 deletions
|
@ -1,22 +1,39 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
import { List as ImmutableList } from 'immutable';
|
||||||
|
|
||||||
export default class Footer extends ImmutablePureComponent {
|
const mapStateToProps = (state, props) => ({
|
||||||
|
copyright: state.getIn(['soapbox', 'copyright']),
|
||||||
|
navlinks: state.getIn(['soapbox', 'navlinks', 'homeFooter'], ImmutableList()),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default @connect(mapStateToProps)
|
||||||
|
class Footer extends ImmutablePureComponent {
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
copyright: PropTypes.string,
|
||||||
|
navlinks: ImmutablePropTypes.list,
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const { copyright, navlinks } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='footer'>
|
<div className='footer'>
|
||||||
<div className='footer-container'>
|
<div className='footer-container'>
|
||||||
<div className='copyright'>
|
<div className='copyright'>
|
||||||
<span>♡{new Date().getFullYear()}. Copying is an act of love. Please copy and share.</span>
|
<span>{copyright}</span>
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><Link to='/about'>About</Link></li>
|
{navlinks.map((link, i) => (
|
||||||
<li><Link to='/about/tos'>Terms of Service</Link></li>
|
<li key={i}>
|
||||||
<li><Link to='/about/privacy'>Privacy Policy</Link></li>
|
<Link to={link.get('url')}>{link.get('title')}</Link>
|
||||||
<li><Link to='/about/dmca'>DMCA</Link></li>
|
</li>
|
||||||
<li><Link to='/about#opensource'>Source Code</Link></li>
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,6 +16,16 @@
|
||||||
},
|
},
|
||||||
"defaultSettings": {
|
"defaultSettings": {
|
||||||
"autoPlayGif": false,
|
"autoPlayGif": false,
|
||||||
"theme": "lime"
|
"theme": "azure"
|
||||||
|
},
|
||||||
|
"copyright": "♡2020. Copying is an act of love. Please copy and share.",
|
||||||
|
"navlinks": {
|
||||||
|
"homeFooter": [
|
||||||
|
{ "title": "About", "url": "/about" },
|
||||||
|
{ "title": "Terms of Service", "url": "/about/tos" },
|
||||||
|
{ "title": "Privacy Policy", "url": "/about/privacy" },
|
||||||
|
{ "title": "DMCA", "url": "/about/dmca" },
|
||||||
|
{ "title": "Source Code", "url": "/about#opensource" }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue