mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
fix(ConsentToggle): remove unused ConsentToggle component
This commit is contained in:
parent
f5ef7d653d
commit
14927942e8
3 changed files with 0 additions and 104 deletions
|
|
@ -1,56 +0,0 @@
|
|||
// Copyright (C) 2017-2023 Smart code 203358507
|
||||
|
||||
const React = require('react');
|
||||
const PropTypes = require('prop-types');
|
||||
const classnames = require('classnames');
|
||||
const { Button, Toggle } = require('stremio/components');
|
||||
const styles = require('./styles');
|
||||
|
||||
const ConsentToggle = React.forwardRef(({ className, label, link, href, onToggle, ...props }, ref) => {
|
||||
const toggleOnClick = React.useCallback((event) => {
|
||||
if (typeof props.onClick === 'function') {
|
||||
props.onClick(event);
|
||||
}
|
||||
|
||||
if (!event.nativeEvent.togglePrevented && typeof onToggle === 'function') {
|
||||
onToggle({
|
||||
type: 'toggle',
|
||||
reactEvent: event,
|
||||
nativeEvent: event.nativeEvent
|
||||
});
|
||||
}
|
||||
}, [onToggle, props.onClick]);
|
||||
const linkOnClick = React.useCallback((event) => {
|
||||
event.nativeEvent.togglePrevented = true;
|
||||
}, []);
|
||||
return (
|
||||
<Toggle {...props} ref={ref} className={classnames(className, styles['consent-toggle-container'])} onClick={toggleOnClick}>
|
||||
<div className={styles['label']}>
|
||||
{label}
|
||||
{' '}
|
||||
{
|
||||
typeof link === 'string' && link.length > 0 && typeof href === 'string' && href.length > 0 ?
|
||||
<Button className={styles['link']} href={href} target={'_blank'} tabIndex={-1} onClick={linkOnClick}>
|
||||
{link}
|
||||
</Button>
|
||||
:
|
||||
null
|
||||
}
|
||||
</div>
|
||||
</Toggle>
|
||||
);
|
||||
});
|
||||
|
||||
ConsentToggle.displayName = 'ConsentToggle';
|
||||
|
||||
ConsentToggle.propTypes = {
|
||||
className: PropTypes.string,
|
||||
checked: PropTypes.bool,
|
||||
label: PropTypes.string,
|
||||
link: PropTypes.string,
|
||||
href: PropTypes.string,
|
||||
onToggle: PropTypes.func,
|
||||
onClick: PropTypes.func
|
||||
};
|
||||
|
||||
module.exports = ConsentToggle;
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// Copyright (C) 2017-2023 Smart code 203358507
|
||||
|
||||
const ConsentToggle = require('./ConsentToggle');
|
||||
|
||||
module.exports = ConsentToggle;
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
// Copyright (C) 2017-2023 Smart code 203358507
|
||||
|
||||
@import (reference) '~@stremio/stremio-colors/less/stremio-colors.less';
|
||||
|
||||
:import('~stremio/components/Toggle/styles.less') {
|
||||
checkbox-icon: icon;
|
||||
}
|
||||
|
||||
.consent-toggle-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 0.5rem 0;
|
||||
border-radius: var(--border-radius);
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
background-color: var(--overlay-color);
|
||||
}
|
||||
|
||||
&:global(.checked) {
|
||||
.label {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
flex: 1;
|
||||
margin-left: 1rem;
|
||||
font-size: 0.9rem;
|
||||
color: var(--primary-foreground-color);
|
||||
opacity: 0.6;
|
||||
|
||||
.link {
|
||||
font-size: 0.9rem;
|
||||
color: var(--primary-accent-color);
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue