import React from 'react';
import PropTypes from 'prop-types';
class Footer extends React.Component {
render() {
return (
<footer className='main-footer'>
<div className="pull-right hidden-xs">
{this.props.content}
{this.props.content && this.props.children ? ' ' : ''}
{this.props.children}
</div>
<strong>
Copyright © {this.props.copyright}
<a
href={this.props.link}
onClick={this.props.onLinkClick ? e => {
e.preventDefault();
e.stopPropagation();
this.props.onLinkClick();
} : () => {}}
>
{this.props.company}
</a>.
</strong>
<em>All rights reserved.</em>
</footer>
);
}
}
Footer.propTypes = {
content: PropTypes.string,
copyright: PropTypes.string,
link: PropTypes.string,
onLinkClick: PropTypes.func,
company: PropTypes.string
};
Footer.defaultProps = {
content: '',
copyright: '',
company: ''
};
export default Footer;
|