You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SoundDeviceButton.tsx 1.2KB

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