2016-12-12 13:27:52 +00:00
|
|
|
import { Link } from 'react-router';
|
|
|
|
|
|
|
|
const outerStyle = {
|
|
|
|
display: 'block',
|
|
|
|
padding: '15px',
|
|
|
|
fontSize: '16px',
|
|
|
|
textDecoration: 'none'
|
|
|
|
};
|
|
|
|
|
|
|
|
const iconStyle = {
|
|
|
|
display: 'inline-block',
|
|
|
|
marginRight: '5px'
|
|
|
|
};
|
|
|
|
|
2017-01-07 23:41:57 +00:00
|
|
|
const ColumnLink = ({ icon, text, to, href, method }) => {
|
2016-12-12 13:27:52 +00:00
|
|
|
if (href) {
|
|
|
|
return (
|
2017-01-07 23:41:57 +00:00
|
|
|
<a href={href} style={outerStyle} className='column-link' data-method={method}>
|
2016-12-12 13:27:52 +00:00
|
|
|
<i className={`fa fa-fw fa-${icon}`} style={iconStyle} />
|
|
|
|
{text}
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (
|
|
|
|
<Link to={to} style={outerStyle} className='column-link'>
|
|
|
|
<i className={`fa fa-fw fa-${icon}`} style={iconStyle} />
|
|
|
|
{text}
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
ColumnLink.propTypes = {
|
|
|
|
icon: React.PropTypes.string.isRequired,
|
|
|
|
text: React.PropTypes.string.isRequired,
|
|
|
|
to: React.PropTypes.string,
|
2017-04-15 11:27:27 +00:00
|
|
|
href: React.PropTypes.string,
|
|
|
|
method: React.PropTypes.string
|
2016-12-12 13:27:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ColumnLink;
|