// @flow import * as React from 'react'; import { withRouter } from 'react-router-dom'; import { inject } from 'mobx-react'; import { MoreIcon } from 'outline-icons'; import type { Share } from 'types'; import CopyToClipboard from 'components/CopyToClipboard'; import SharesStore from 'stores/SharesStore'; import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu'; type Props = { label?: React.Node, onOpen?: () => *, onClose: () => *, history: Object, shares: SharesStore, share: Share, }; class ShareMenu extends React.Component { onGoToDocument = (ev: SyntheticEvent<*>) => { ev.preventDefault(); this.props.history.push(this.props.share.documentUrl); }; onRevoke = (ev: SyntheticEvent<*>) => { ev.preventDefault(); this.props.shares.revoke(this.props.share); }; render() { const { share, label, onOpen, onClose } = this.props; return ( } onOpen={onOpen} onClose={onClose} > Copy link Go to document
Revoke link
); } } export default withRouter(inject('shares')(ShareMenu));