2017-05-03 03:04:16 +03:00
|
|
|
import React from 'react';
|
2017-04-21 21:05:35 +03:00
|
|
|
import PropTypes from 'prop-types';
|
2017-05-18 20:14:03 +03:00
|
|
|
import Link from 'react-router/lib/Link';
|
2016-12-12 15:27:52 +02:00
|
|
|
|
2017-04-21 19:17:55 +03:00
|
|
|
const ColumnLink = ({ icon, text, to, href, method, hideOnMobile }) => {
|
2016-12-12 15:27:52 +02:00
|
|
|
if (href) {
|
|
|
|
return (
|
2017-04-23 06:21:38 +03:00
|
|
|
<a href={href} className={`column-link ${hideOnMobile ? 'hidden-on-mobile' : ''}`} data-method={method}>
|
2017-04-23 05:26:55 +03:00
|
|
|
<i className={`fa fa-fw fa-${icon} column-link__icon`} />
|
2016-12-12 15:27:52 +02:00
|
|
|
{text}
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (
|
2017-04-23 05:26:55 +03:00
|
|
|
<Link to={to} className={`column-link ${hideOnMobile ? 'hidden-on-mobile' : ''}`}>
|
|
|
|
<i className={`fa fa-fw fa-${icon} column-link__icon`} />
|
2016-12-12 15:27:52 +02:00
|
|
|
{text}
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
ColumnLink.propTypes = {
|
2017-04-21 21:05:35 +03:00
|
|
|
icon: PropTypes.string.isRequired,
|
|
|
|
text: PropTypes.string.isRequired,
|
|
|
|
to: PropTypes.string,
|
|
|
|
href: PropTypes.string,
|
|
|
|
method: PropTypes.string,
|
2017-05-20 18:31:47 +03:00
|
|
|
hideOnMobile: PropTypes.bool,
|
2016-12-12 15:27:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ColumnLink;
|