mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-28 18:53:04 +00:00
isProtected property added
This commit is contained in:
parent
eb19a3b388
commit
67fd80a63e
1 changed files with 3 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ const Icon = require('stremio-icons/dom');
|
||||||
const { Button } = require('stremio/common');
|
const { Button } = require('stremio/common');
|
||||||
const styles = require('./styles');
|
const styles = require('./styles');
|
||||||
|
|
||||||
const Addon = ({ className, id, name, logo, description, types, version, transportUrl, installed, toggle }) => {
|
const Addon = ({ className, id, name, logo, description, types, version, transportUrl, installed, isProtected, toggle }) => {
|
||||||
const onKeyUp = React.useCallback((event) => {
|
const onKeyUp = React.useCallback((event) => {
|
||||||
if (event.key === 'Enter' && typeof toggle === 'function') {
|
if (event.key === 'Enter' && typeof toggle === 'function') {
|
||||||
toggle(event);
|
toggle(event);
|
||||||
|
|
@ -52,7 +52,7 @@ const Addon = ({ className, id, name, logo, description, types, version, transpo
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles['buttons-container']}>
|
<div className={styles['buttons-container']}>
|
||||||
<Button className={installed ? styles['uninstall-button-container'] : styles['install-button-container']} title={installed ? 'Uninstall' : 'Install'} tabIndex={-1} data-id={id} onClick={toggle}>
|
<Button className={installed ? styles['uninstall-button-container'] : styles['install-button-container']} title={installed ? 'Uninstall' : 'Install'} tabIndex={-1} data-id={id} disabled={isProtected} onClick={toggle}>
|
||||||
<div className={styles['label']}>{installed ? 'Uninstall' : 'Install'}</div>
|
<div className={styles['label']}>{installed ? 'Uninstall' : 'Install'}</div>
|
||||||
</Button>
|
</Button>
|
||||||
<Button className={styles['share-button-container']} title={'Share addon'} tabIndex={-1}>
|
<Button className={styles['share-button-container']} title={'Share addon'} tabIndex={-1}>
|
||||||
|
|
@ -74,6 +74,7 @@ Addon.propTypes = {
|
||||||
version: PropTypes.string,
|
version: PropTypes.string,
|
||||||
transportUrl: PropTypes.string,
|
transportUrl: PropTypes.string,
|
||||||
installed: PropTypes.bool,
|
installed: PropTypes.bool,
|
||||||
|
isProtected: PropTypes.bool,
|
||||||
toggle: PropTypes.func
|
toggle: PropTypes.func
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue