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

SoundDeviceButton.tsx 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* eslint-disable lines-around-comment */
  2. import React, { useCallback } from 'react';
  3. import { useDispatch } from 'react-redux';
  4. import { openSheet } from '../../../../base/dialog/actions';
  5. import Button from '../../../../base/ui/components/native/Button';
  6. import { BUTTON_TYPES } from '../../../../base/ui/constants';
  7. // @ts-ignore
  8. import AudioRoutePickerDialog from '../../../../mobile/audio-mode/components/AudioRoutePickerDialog';
  9. import AudioIcon from './AudioIcon';
  10. // @ts-ignore
  11. import styles from './styles';
  12. /**
  13. * Button for selecting sound device in carmode.
  14. *
  15. * @returns {JSX.Element} - The sound device button.
  16. */
  17. const SelectSoundDevice = (): JSX.Element => {
  18. const dispatch = useDispatch();
  19. const onSelect = useCallback(() =>
  20. dispatch(openSheet(AudioRoutePickerDialog))
  21. , [ dispatch ]);
  22. return (
  23. <Button
  24. accessibilityLabel = 'carmode.actions.selectSoundDevice'
  25. icon = { AudioIcon }
  26. labelKey = 'carmode.actions.selectSoundDevice'
  27. onClick = { onSelect }
  28. style = { styles.soundDeviceButton }
  29. type = { BUTTON_TYPES.SECONDARY } />
  30. );
  31. };
  32. export default SelectSoundDevice;