mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
refactor: remove unecessary props
This commit is contained in:
parent
a9e218db62
commit
16e6a3cf4d
4 changed files with 9 additions and 24 deletions
|
|
@ -12,7 +12,7 @@ const NavMenu = require('./NavMenu');
|
|||
const styles = require('./styles');
|
||||
const { t } = require('i18next');
|
||||
|
||||
const HorizontalNavBar = React.memo(({ className, route, query, title, backButton, searchBar, fullscreenButton, navMenu, onContextMenu, ...props }) => {
|
||||
const HorizontalNavBar = React.memo(({ className, route, query, title, backButton, searchBar, fullscreenButton, navMenu, ...props }) => {
|
||||
const backButtonOnClick = React.useCallback(() => {
|
||||
window.history.back();
|
||||
}, []);
|
||||
|
|
@ -25,7 +25,7 @@ const HorizontalNavBar = React.memo(({ className, route, query, title, backButto
|
|||
</Button>
|
||||
), []);
|
||||
return (
|
||||
<nav {...props} className={classnames(className, styles['horizontal-nav-bar-container'])} onContextMenu={onContextMenu}>
|
||||
<nav {...props} className={classnames(className, styles['horizontal-nav-bar-container'])}>
|
||||
{
|
||||
backButton ?
|
||||
<Button className={classnames(styles['button-container'], styles['back-button-container'])} tabIndex={-1} onClick={backButtonOnClick}>
|
||||
|
|
@ -82,8 +82,7 @@ HorizontalNavBar.propTypes = {
|
|||
backButton: PropTypes.bool,
|
||||
searchBar: PropTypes.bool,
|
||||
fullscreenButton: PropTypes.bool,
|
||||
navMenu: PropTypes.bool,
|
||||
onContextMenu: PropTypes.func,
|
||||
navMenu: PropTypes.bool
|
||||
};
|
||||
|
||||
module.exports = HorizontalNavBar;
|
||||
|
|
|
|||
|
|
@ -40,9 +40,6 @@ const ControlBar = ({
|
|||
onToggleSideDrawer,
|
||||
onToggleOptionsMenu,
|
||||
onToggleStatisticsMenu,
|
||||
onContextMenu,
|
||||
onTouchStart,
|
||||
onTouchEnd,
|
||||
...props
|
||||
}) => {
|
||||
const { chromecast } = useServices();
|
||||
|
|
@ -106,7 +103,7 @@ const ControlBar = ({
|
|||
};
|
||||
}, []);
|
||||
return (
|
||||
<div {...props} className={classnames(className, styles['control-bar-container'])} onContextMenu={onContextMenu} onTouchStart={onTouchStart} onTouchEnd={onTouchEnd}>
|
||||
<div {...props} className={classnames(className, styles['control-bar-container'])}>
|
||||
<SeekBar
|
||||
className={styles['seek-bar']}
|
||||
time={time}
|
||||
|
|
@ -209,9 +206,6 @@ ControlBar.propTypes = {
|
|||
onToggleSideDrawer: PropTypes.func,
|
||||
onToggleOptionsMenu: PropTypes.func,
|
||||
onToggleStatisticsMenu: PropTypes.func,
|
||||
onContextMenu: PropTypes.func,
|
||||
onTouchStart: PropTypes.func,
|
||||
onTouchEnd: PropTypes.func,
|
||||
};
|
||||
|
||||
module.exports = ControlBar;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const { useServices } = require('stremio/services');
|
|||
const Option = require('./Option');
|
||||
const styles = require('./styles');
|
||||
|
||||
const OptionsMenu = ({ className, stream, playbackDevices, style }) => {
|
||||
const OptionsMenu = ({ className, stream, playbackDevices }) => {
|
||||
const { t } = useTranslation();
|
||||
const { core } = useServices();
|
||||
const platform = usePlatform();
|
||||
|
|
@ -71,7 +71,7 @@ const OptionsMenu = ({ className, stream, playbackDevices, style }) => {
|
|||
}, []);
|
||||
|
||||
return (
|
||||
<div style={style} className={classnames(className, styles['options-menu-container'])} onMouseDown={onMouseDown}>
|
||||
<div className={classnames(className, styles['options-menu-container'])} onMouseDown={onMouseDown}>
|
||||
{
|
||||
streamingUrl || downloadUrl ?
|
||||
<Option
|
||||
|
|
@ -111,14 +111,9 @@ const OptionsMenu = ({ className, stream, playbackDevices, style }) => {
|
|||
};
|
||||
|
||||
OptionsMenu.propTypes = {
|
||||
menuRef: PropTypes.oneOfType([
|
||||
PropTypes.func,
|
||||
PropTypes.shape({ current: PropTypes.any })
|
||||
]),
|
||||
className: PropTypes.string,
|
||||
stream: PropTypes.object,
|
||||
playbackDevices: PropTypes.array,
|
||||
style: PropTypes.object,
|
||||
};
|
||||
|
||||
module.exports = OptionsMenu;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright (C) 2017-2024 Smart code 203358507
|
||||
|
||||
import React, { BaseSyntheticEvent } from 'react';
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import Icon from '@stremio/stremio-icons/react';
|
||||
import styles from './SideDrawerButton.less';
|
||||
|
|
@ -8,14 +8,11 @@ import styles from './SideDrawerButton.less';
|
|||
type Props = {
|
||||
className: string,
|
||||
onClick: () => void,
|
||||
onContextMenu: () => void,
|
||||
onTouchStart: (event: BaseSyntheticEvent) => void,
|
||||
onTouchEnd: () => void,
|
||||
};
|
||||
|
||||
const SideDrawerButton = ({ className, onClick, onContextMenu, onTouchStart, onTouchEnd }: Props) => {
|
||||
const SideDrawerButton = ({ className, onClick }: Props) => {
|
||||
return (
|
||||
<div className={classNames(className, styles['side-drawer-button'])} onClick={onClick} onContextMenu={onContextMenu} onTouchStart={onTouchStart} onTouchEnd={onTouchEnd}>
|
||||
<div className={classNames(className, styles['side-drawer-button'])} onClick={onClick}>
|
||||
<Icon name={'chevron-back'} className={styles['icon']} />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue