2022-07-11 12:30:37 +00:00
|
|
|
/* eslint-disable import/order */
|
2022-06-29 13:59:49 +00:00
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
import { IconMenuDown } from '../../../base/icons';
|
2022-07-11 12:30:37 +00:00
|
|
|
|
2022-06-29 13:59:49 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import { Label } from '../../../base/label';
|
2022-07-11 12:30:37 +00:00
|
|
|
|
2022-06-29 13:59:49 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import { Tooltip } from '../../../base/tooltip';
|
2022-07-11 12:30:37 +00:00
|
|
|
|
2022-06-29 13:59:49 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import { setTopPanelVisible } from '../../../filmstrip/actions.web';
|
|
|
|
|
|
|
|
const ToggleTopPanelLabel = () => {
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
const { t } = useTranslation();
|
|
|
|
const topPanelHidden = !useSelector((state: any) => state['features/filmstrip'].topPanelVisible);
|
|
|
|
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;
|