/** * @flow * @file Content Explorer Delete Confirmation Dialog * @author Box */ import React from 'react'; import Modal from 'react-modal'; import noop from 'lodash/noop'; import { injectIntl, FormattedMessage } from 'react-intl'; import PrimaryButton from '../../components/primary-button/PrimaryButton'; import Button from '../../components/button/Button'; import messages from '../common/messages'; import ShareAccessSelect from '../common/share-access-select'; import { CLASS_MODAL_CONTENT, CLASS_MODAL_OVERLAY, CLASS_MODAL } from '../../constants'; import './ShareDialog.scss'; type Props = { appElement: HTMLElement, canSetShareAccess: boolean, isLoading: boolean, isOpen: boolean, item: BoxItem, onCancel: Function, onShareAccessChange: Function, parentElement: HTMLElement, } & InjectIntlProvidedProps; const ShareDialog = ({ isOpen, canSetShareAccess, onShareAccessChange, onCancel, item, isLoading, parentElement, appElement, intl, }: Props) => { let textInput = null; const copy = () => { if (textInput instanceof HTMLInputElement) { textInput.select(); document.execCommand('copy'); } }; const { shared_link: sharedLink }: BoxItem = item; const { url } = sharedLink || { url: intl.formatMessage(messages.shareDialogNone), }; /* eslint-disable jsx-a11y/label-has-for */ return ( parentElement} portalClassName={`${CLASS_MODAL} be-modal-share`} >
); }; export default injectIntl(ShareDialog);