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.1KB

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