openreplay/frontend/app/components/ui/Link/Link.js
2021-05-01 15:12:01 +05:30

19 lines
No EOL
551 B
JavaScript

import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import cn from 'classnames';
import { withSiteId } from 'App/routes';
import styles from './link.css';
const OpenReplayLink = ({ siteId, to, className="", dispatch, ...other }) => (
<Link
{ ...other }
className={ cn(className, styles.link) }
to={ withSiteId(to, siteId) }
/>
);
OpenReplayLink.displayName = 'OpenReplayLink';
export default connect((state, props) => ({
siteId: props.siteId || state.getIn([ 'user', 'siteId' ])
}))(OpenReplayLink);