"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7305/react/features/conference/components/native/carmode/EndMeetingButton.tsx" (26 May 2023, 1228 Bytes) of package /linux/misc/jitsi-meet-7305.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 "EndMeetingButton.tsx": 7259_vs_7266.

    1 import React, { useCallback } from 'react';
    2 import { useDispatch } from 'react-redux';
    3 
    4 import { createToolbarEvent } from '../../../../analytics/AnalyticsEvents';
    5 import { sendAnalytics } from '../../../../analytics/functions';
    6 import { appNavigate } from '../../../../app/actions.native';
    7 import Button from '../../../../base/ui/components/native/Button';
    8 import { BUTTON_TYPES } from '../../../../base/ui/constants.native';
    9 
   10 import EndMeetingIcon from './EndMeetingIcon';
   11 import styles from './styles';
   12 
   13 /**
   14  * Button for ending meeting from carmode.
   15  *
   16  * @returns {JSX.Element} - The end meeting button.
   17  */
   18 const EndMeetingButton = (): JSX.Element => {
   19     const dispatch = useDispatch();
   20 
   21     const onSelect = useCallback(() => {
   22         sendAnalytics(createToolbarEvent('hangup'));
   23 
   24         dispatch(appNavigate(undefined));
   25     }, [ dispatch ]);
   26 
   27     return (
   28         <Button
   29             accessibilityLabel = 'toolbar.accessibilityLabel.leaveConference'
   30             icon = { EndMeetingIcon }
   31             labelKey = 'toolbar.leaveConference'
   32             onClick = { onSelect }
   33             style = { styles.endMeetingButton }
   34             type = { BUTTON_TYPES.DESTRUCTIVE } />
   35     );
   36 };
   37 
   38 export default EndMeetingButton;