mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
Create Tooltip component Fix Popover positioning calculations Add margins to popover Remove @atlaskit/tooltip Update all components to use the new Tooltip component Added tooltip actions and reducers for the following functionality: when a user hovers over an element is sees the tooltip for that element and then hovers another element that has a tooltip, instead of using the delay and animations we just unmount the current tooltip and mount the next one immediately
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import React, { useCallback } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
import { IReduxState } from '../../../app/types';
|
|
import { IconArrowDown } from '../../../base/icons/svg/index';
|
|
import Label from '../../../base/label/components/web/Label';
|
|
import Tooltip from '../../../base/tooltip/components/Tooltip';
|
|
import { setTopPanelVisible } from '../../../filmstrip/actions.web';
|
|
|
|
const ToggleTopPanelLabel = () => {
|
|
const dispatch = useDispatch();
|
|
const { t } = useTranslation();
|
|
const topPanelHidden = !useSelector((state: IReduxState) => state['features/filmstrip'].topPanelVisible);
|
|
const onClick = useCallback(() => {
|
|
dispatch(setTopPanelVisible(true));
|
|
}, []);
|
|
|
|
return topPanelHidden && (<Tooltip
|
|
content = { t('toggleTopPanelLabel') }
|
|
position = { 'bottom' }>
|
|
<Label
|
|
icon = { IconArrowDown }
|
|
onClick = { onClick } />
|
|
</Tooltip>);
|
|
};
|
|
|
|
export default ToggleTopPanelLabel;
|