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:
parent
2596c463fe
commit
7a8350356a
|
@ -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';
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue