2017-05-03 00:04:16 +00:00
|
|
|
import React from 'react';
|
2017-04-21 18:05:35 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2017-10-08 00:55:58 +00:00
|
|
|
import { Link } from 'react-router-dom';
|
2016-12-12 13:27:52 +00:00
|
|
|
|
2017-07-26 11:46:53 +00:00
|
|
|
const ColumnLink = ({ icon, text, to, href, method }) => {
|
2016-12-12 13:27:52 +00:00
|
|
|
if (href) {
|
|
|
|
return (
|
2017-07-26 11:46:53 +00:00
|
|
|
<a href={href} className='column-link' data-method={method}>
|
2017-04-23 02:26:55 +00:00
|
|
|
<i className={`fa fa-fw fa-${icon} column-link__icon`} />
|
2016-12-12 13:27:52 +00:00
|
|
|
{text}
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (
|
2017-07-26 11:46:53 +00:00
|
|
|
<Link to={to} className='column-link'>
|
2017-04-23 02:26:55 +00:00
|
|
|
<i className={`fa fa-fw fa-${icon} column-link__icon`} />
|
2016-12-12 13:27:52 +00:00
|
|
|
{text}
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
ColumnLink.propTypes = {
|
2017-04-21 18:05:35 +00:00
|
|
|
icon: PropTypes.string.isRequired,
|
|
|
|
text: PropTypes.string.isRequired,
|
|
|
|
to: PropTypes.string,
|
|
|
|
href: PropTypes.string,
|
|
|
|
method: PropTypes.string,
|
2016-12-12 13:27:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ColumnLink;
|