mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-18 17:02:12 +00:00
share button dropped
This commit is contained in:
parent
255f92e897
commit
8ddc947262
4 changed files with 0 additions and 46 deletions
|
|
@ -7,7 +7,6 @@ const MetaPreviewButton = require('./MetaPreviewButton');
|
|||
const MuteButton = require('./MuteButton');
|
||||
const PlayPauseButton = require('./PlayPauseButton');
|
||||
const SeekBar = require('./SeekBar');
|
||||
const ShareButton = require('./ShareButton');
|
||||
const SubtitlesButton = require('./SubtitlesButton');
|
||||
const VolumeSlider = require('./VolumeSlider');
|
||||
const styles = require('./styles');
|
||||
|
|
@ -72,7 +71,6 @@ const ControlBar = ({
|
|||
<Button className={classnames(styles['control-bar-button'], 'disabled')} tabIndex={-1}>
|
||||
<Icon className={'icon'} icon={'ic_videos'} />
|
||||
</Button>
|
||||
<ShareButton className={styles['control-bar-button']} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
const React = require('react');
|
||||
const PropTypes = require('prop-types');
|
||||
const classnames = require('classnames');
|
||||
const Icon = require('stremio-icons/dom');
|
||||
const { Button, ModalDialog, SharePrompt, useBinaryState } = require('stremio/common');
|
||||
const styles = require('./styles');
|
||||
|
||||
const ShareButton = ({ className, url }) => {
|
||||
const [modalOpen, openModal, closeModal] = useBinaryState(false);
|
||||
const labelButtonOnClick = React.useCallback((event) => {
|
||||
if (!event.nativeEvent.openModalPrevented) {
|
||||
openModal();
|
||||
}
|
||||
}, []);
|
||||
const modalDialogOnClick = React.useCallback((event) => {
|
||||
event.nativeEvent.openModalPrevented = true;
|
||||
}, []);
|
||||
return (
|
||||
<Button className={classnames(className, { 'disabled': typeof url !== 'string' })} tabIndex={-1} onClick={labelButtonOnClick}>
|
||||
<Icon className={'icon'} icon={'ic_share'} />
|
||||
{
|
||||
modalOpen ?
|
||||
<ModalDialog title={'Share'} onCloseRequest={closeModal} onClick={modalDialogOnClick}>
|
||||
<SharePrompt className={styles['share-prompt']} url={url} />
|
||||
</ModalDialog>
|
||||
:
|
||||
null
|
||||
}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
ShareButton.propTypes = {
|
||||
className: PropTypes.string,
|
||||
url: PropTypes.string
|
||||
};
|
||||
|
||||
module.exports = ShareButton;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
const ShareButton = require('./ShareButton');
|
||||
|
||||
module.exports = ShareButton;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
.share-prompt {
|
||||
width: 24rem;
|
||||
}
|
||||
Loading…
Reference in a new issue