2022-09-05 11:24:13 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2022-06-29 13:59:49 +00:00
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
|
2022-10-20 09:11:27 +00:00
|
|
|
import { IReduxState } from '../../../app/types';
|
2022-07-27 09:56:07 +00:00
|
|
|
import { IconMenuDown } from '../../../base/icons/svg/index';
|
2022-10-11 10:47:54 +00:00
|
|
|
import Label from '../../../base/label/components/web/Label';
|
2022-06-29 13:59:49 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import { Tooltip } from '../../../base/tooltip';
|
|
|
|
// @ts-ignore
|
|
|
|
import { setTopPanelVisible } from '../../../filmstrip/actions.web';
|
|
|
|
|
|
|
|
const ToggleTopPanelLabel = () => {
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
const { t } = useTranslation();
|
2022-10-20 09:11:27 +00:00
|
|
|
const topPanelHidden = !useSelector((state: IReduxState) => state['features/filmstrip'].topPanelVisible);
|
2022-06-29 13:59:49 +00:00
|
|
|
const onClick = useCallback(() => {
|
|
|
|
dispatch(setTopPanelVisible(true));
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
return topPanelHidden && (<Tooltip
|
2022-07-11 12:30:37 +00:00
|
|
|
content = { t('toggleTopPanelLabel') }
|
2022-06-29 13:59:49 +00:00
|
|
|
position = { 'bottom' }>
|
|
|
|
<Label
|
2022-07-11 12:30:37 +00:00
|
|
|
icon = { IconMenuDown }
|
|
|
|
onClick = { onClick } />
|
2022-06-29 13:59:49 +00:00
|
|
|
</Tooltip>);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ToggleTopPanelLabel;
|