2017-04-21 11:05:35 -07:00
|
|
|
import PropTypes from 'prop-types';
|
2016-12-12 05:27:52 -08:00
|
|
|
import { Link } from 'react-router';
|
|
|
|
|
|
|
|
const outerStyle = {
|
|
|
|
padding: '15px',
|
|
|
|
fontSize: '16px',
|
|
|
|
textDecoration: 'none'
|
|
|
|
};
|
|
|
|
|
|
|
|
const iconStyle = {
|
|
|
|
display: 'inline-block',
|
|
|
|
marginRight: '5px'
|
|
|
|
};
|
|
|
|
|
2017-04-21 09:17:55 -07:00
|
|
|
const ColumnLink = ({ icon, text, to, href, method, hideOnMobile }) => {
|
2016-12-12 05:27:52 -08:00
|
|
|
if (href) {
|
|
|
|
return (
|
2017-04-21 09:17:55 -07:00
|
|
|
<a href={href} style={outerStyle} className={`column-link ${hideOnMobile ? 'hidden-on-mobile' : ''}`} data-method={method}>
|
2016-12-12 05:27:52 -08:00
|
|
|
<i className={`fa fa-fw fa-${icon}`} style={iconStyle} />
|
|
|
|
{text}
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (
|
2017-04-21 09:17:55 -07:00
|
|
|
<Link to={to} style={outerStyle} className={`column-link ${hideOnMobile ? 'hidden-on-mobile' : ''}`}>
|
2016-12-12 05:27:52 -08:00
|
|
|
<i className={`fa fa-fw fa-${icon}`} style={iconStyle} />
|
|
|
|
{text}
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
ColumnLink.propTypes = {
|
2017-04-21 11:05:35 -07:00
|
|
|
icon: PropTypes.string.isRequired,
|
|
|
|
text: PropTypes.string.isRequired,
|
|
|
|
to: PropTypes.string,
|
|
|
|
href: PropTypes.string,
|
|
|
|
method: PropTypes.string,
|
|
|
|
hideOnMobile: PropTypes.bool
|
2016-12-12 05:27:52 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ColumnLink;
|