feat(base/react): removed old web Switch component and exports (#12481)

* feat(base/react): removed old Switch component and exports
This commit is contained in:
Calinteodor 2022-11-01 11:42:36 +02:00 committed by GitHub
parent 2596c463fe
commit 7a8350356a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 66 deletions

View File

@ -17,6 +17,5 @@ export { default as NavigateSectionListSectionHeader }
export { default as Pressable } from './Pressable';
export { default as SectionList } from './SectionList';
export { default as SlidingView } from './SlidingView';
export { default as Switch } from './Switch';
export { default as Text } from './Text';
export { default as TintedView } from './TintedView';

View File

@ -1,64 +0,0 @@
import React, { Component } from 'react';
import UISwitch from '../../../ui/components/web/Switch';
type Props = {
/**
* CSS class name.
*/
className: string;
/**
* Indicates whether the switch is disabled or not.
*/
disabled: boolean;
/**
* ID of the toggle.
*/
id: string;
/**
* Handler called when the user presses the switch.
*/
onValueChange: (checked?: boolean) => void;
/**
* The current value.
*/
value: boolean;
};
/**
* Renders a boolean input.
*/
export default class Switch extends Component<Props> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
const {
className,
disabled,
onValueChange,
value,
id,
...props
} = this.props;
return (
<div className = { className }>
<UISwitch
checked = { value }
disabled = { disabled }
id = { id }
onChange = { onValueChange }
{ ...props } />
</div>
);
}
}

View File

@ -14,6 +14,5 @@ export { default as NavigateSectionListItem } from
export { default as NavigateSectionListSectionHeader }
from './NavigateSectionListSectionHeader';
export { default as SectionList } from './SectionList';
export { default as Switch } from './Switch';
export { default as Text } from './Text';
export { default as Watermarks } from './Watermarks';