You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
873 B
33 lines
873 B
8 years ago
|
import React from 'react';
|
||
8 years ago
|
import PropTypes from 'prop-types';
|
||
8 years ago
|
import { Link } from 'react-router';
|
||
|
|
||
8 years ago
|
const ColumnLink = ({ icon, text, to, href, method, hideOnMobile }) => {
|
||
8 years ago
|
if (href) {
|
||
|
return (
|
||
8 years ago
|
<a href={href} className={`column-link ${hideOnMobile ? 'hidden-on-mobile' : ''}`} data-method={method}>
|
||
8 years ago
|
<i className={`fa fa-fw fa-${icon} column-link__icon`} />
|
||
8 years ago
|
{text}
|
||
|
</a>
|
||
|
);
|
||
|
} else {
|
||
|
return (
|
||
8 years ago
|
<Link to={to} className={`column-link ${hideOnMobile ? 'hidden-on-mobile' : ''}`}>
|
||
|
<i className={`fa fa-fw fa-${icon} column-link__icon`} />
|
||
8 years ago
|
{text}
|
||
|
</Link>
|
||
|
);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
ColumnLink.propTypes = {
|
||
8 years ago
|
icon: PropTypes.string.isRequired,
|
||
|
text: PropTypes.string.isRequired,
|
||
|
to: PropTypes.string,
|
||
|
href: PropTypes.string,
|
||
|
method: PropTypes.string,
|
||
|
hideOnMobile: PropTypes.bool
|
||
8 years ago
|
};
|
||
|
|
||
|
export default ColumnLink;
|