"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7313/react/features/conference/components/web/ToggleTopPanelLabel.tsx" (2 Jun 2023, 1044 Bytes) of package /linux/misc/jitsi-meet-7313.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 "ToggleTopPanelLabel.tsx": jitsi-meet_8319_vs_jitsi-meet_8615.

    1 import React, { useCallback } from 'react';
    2 import { useTranslation } from 'react-i18next';
    3 import { useDispatch, useSelector } from 'react-redux';
    4 
    5 import { IReduxState } from '../../../app/types';
    6 import { IconArrowDown } from '../../../base/icons/svg/index';
    7 import Label from '../../../base/label/components/web/Label';
    8 import Tooltip from '../../../base/tooltip/components/Tooltip';
    9 import { setTopPanelVisible } from '../../../filmstrip/actions.web';
   10 
   11 const ToggleTopPanelLabel = () => {
   12     const dispatch = useDispatch();
   13     const { t } = useTranslation();
   14     const topPanelHidden = !useSelector((state: IReduxState) => state['features/filmstrip'].topPanelVisible);
   15     const onClick = useCallback(() => {
   16         dispatch(setTopPanelVisible(true));
   17     }, []);
   18 
   19     return topPanelHidden ? (<Tooltip
   20         content = { t('toggleTopPanelLabel') }
   21         position = { 'bottom' }>
   22         <Label
   23             icon = { IconArrowDown }
   24             onClick = { onClick } />
   25     </Tooltip>) : null;
   26 };
   27 
   28 export default ToggleTopPanelLabel;