Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435
  1. import React from 'react';
  2. import { ColorValue } from 'react-native';
  3. import { Switch as NativeSwitch } from 'react-native-paper';
  4. import { SwitchProps } from '../types';
  5. interface Props extends SwitchProps {
  6. /**
  7. * Custom styles for the switch.
  8. */
  9. style?: Object;
  10. /**
  11. * Color of the switch button.
  12. */
  13. thumbColor?: ColorValue;
  14. /**
  15. * Color of the switch background.
  16. */
  17. trackColor?: Object;
  18. }
  19. const Switch = ({ checked, disabled, onChange, thumbColor, trackColor, style }: Props) => (
  20. <NativeSwitch
  21. disabled = { disabled }
  22. onValueChange = { onChange }
  23. style = { style }
  24. thumbColor = { thumbColor }
  25. trackColor = { trackColor }
  26. value = { checked } />
  27. );
  28. export default Switch;