"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7307/react/features/conference/components/native/carmode/SoundDeviceButton.tsx" (30 May 2023, 1135 Bytes) of package /linux/misc/jitsi-meet-7307.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TSX (TypeScript with React) source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "SoundDeviceButton.tsx": 7259_vs_7266.

    1 import React, { useCallback } from 'react';
    2 import { useDispatch } from 'react-redux';
    3 
    4 import { openSheet } from '../../../../base/dialog/actions';
    5 import Button from '../../../../base/ui/components/native/Button';
    6 import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
    7 import AudioRoutePickerDialog from '../../../../mobile/audio-mode/components/AudioRoutePickerDialog';
    8 
    9 import AudioIcon from './AudioIcon';
   10 import styles from './styles';
   11 
   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 
   20     const onSelect = useCallback(() =>
   21         dispatch(openSheet(AudioRoutePickerDialog))
   22     , [ dispatch ]);
   23 
   24     return (
   25         <Button
   26             accessibilityLabel = 'carmode.actions.selectSoundDevice'
   27             icon = { AudioIcon }
   28             labelKey = 'carmode.actions.selectSoundDevice'
   29             onClick = { onSelect }
   30             style = { styles.soundDeviceButton }
   31             type = { BUTTON_TYPES.SECONDARY } />
   32     );
   33 };
   34 
   35 export default SelectSoundDevice;