2018-07-17 18:51:56 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import classnames from 'classnames';
|
|
|
|
import Gridicon from 'gridicons';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import './style.scss';
|
2018-08-20 21:18:13 +00:00
|
|
|
import { Link } from '@woocommerce/components';
|
2018-07-17 18:51:56 +00:00
|
|
|
|
2020-02-14 02:23:21 +00:00
|
|
|
const ActivityOutboundLink = ( props ) => {
|
2018-07-17 18:51:56 +00:00
|
|
|
const { href, type, className, children, ...restOfProps } = props;
|
2020-02-14 02:23:21 +00:00
|
|
|
const classes = classnames(
|
|
|
|
'woocommerce-layout__activity-panel-outbound-link',
|
|
|
|
className
|
|
|
|
);
|
2018-07-17 18:51:56 +00:00
|
|
|
return (
|
2020-02-14 02:23:21 +00:00
|
|
|
<Link
|
|
|
|
href={ href }
|
|
|
|
type={ type }
|
|
|
|
className={ classes }
|
|
|
|
{ ...restOfProps }
|
|
|
|
>
|
2018-07-17 18:51:56 +00:00
|
|
|
{ children }
|
|
|
|
<Gridicon icon="arrow-right" />
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
ActivityOutboundLink.propTypes = {
|
|
|
|
href: PropTypes.string.isRequired,
|
|
|
|
type: PropTypes.oneOf( [ 'wp-admin', 'wc-admin', 'external' ] ).isRequired,
|
|
|
|
className: PropTypes.string,
|
|
|
|
};
|
|
|
|
|
|
|
|
ActivityOutboundLink.defaultProps = {
|
|
|
|
type: 'wp-admin',
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ActivityOutboundLink;
|