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-11-08 10:24:32 +00:00
|
|
|
import { IconArrowDown } from '../../../base/icons/svg/index';
|
2022-10-11 10:47:54 +00:00
|
|
|
import Label from '../../../base/label/components/web/Label';
|
2022-11-28 10:52:45 +00:00
|
|
|
// eslint-disable-next-line lines-around-comment
|
2022-06-29 13:59:49 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import { Tooltip } from '../../../base/tooltip';
|
|
|
|
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-11-08 10:24:32 +00:00
|
|
|
icon = { IconArrowDown }
|
2022-07-11 12:30:37 +00:00
|
|
|
onClick = { onClick } />
|
2022-06-29 13:59:49 +00:00
|
|
|
</Tooltip>);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ToggleTopPanelLabel;
|