2020-02-26 03:11:28 +00:00
|
|
|
import React, { memo } from 'react';
|
|
|
|
import { IoIosCamera } from 'react-icons/io';
|
2020-11-25 20:46:03 +00:00
|
|
|
import { FaTrashAlt } from 'react-icons/fa';
|
2020-02-26 03:11:28 +00:00
|
|
|
import { MdRotate90DegreesCcw } from 'react-icons/md';
|
2020-03-19 15:37:38 +00:00
|
|
|
import { useTranslation } from 'react-i18next';
|
2020-02-26 03:11:28 +00:00
|
|
|
|
2020-11-29 23:06:06 +00:00
|
|
|
import { primaryTextColor } from './colors';
|
|
|
|
|
2020-11-25 20:46:03 +00:00
|
|
|
import ExportButton from './components/ExportButton';
|
2020-11-29 23:06:06 +00:00
|
|
|
import ToggleExportConfirm from './components/ToggleExportConfirm';
|
2020-02-26 03:11:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
const RightMenu = memo(({
|
|
|
|
isRotationSet, rotation, areWeCutting, increaseRotation, deleteSource, renderCaptureFormatButton,
|
2020-11-29 23:06:06 +00:00
|
|
|
capture, onExportPress, outSegments, hasVideo, autoMerge, exportConfirmEnabled, toggleExportConfirmEnabled,
|
2020-12-11 20:29:40 +00:00
|
|
|
simpleMode,
|
2020-02-26 03:11:28 +00:00
|
|
|
}) => {
|
|
|
|
const rotationStr = `${rotation}°`;
|
|
|
|
|
2020-03-19 15:37:38 +00:00
|
|
|
const { t } = useTranslation();
|
|
|
|
|
2020-02-26 03:11:28 +00:00
|
|
|
return (
|
2020-02-27 09:17:35 +00:00
|
|
|
<div className="no-user-select" style={{ padding: '.3em', display: 'flex', alignItems: 'center' }}>
|
2020-04-18 06:50:56 +00:00
|
|
|
{hasVideo && (
|
2020-12-13 23:26:21 +00:00
|
|
|
<>
|
|
|
|
<span style={{ textAlign: 'right', display: 'inline-block' }}>{isRotationSet && rotationStr}</span>
|
2020-04-18 06:50:56 +00:00
|
|
|
<MdRotate90DegreesCcw
|
|
|
|
size={26}
|
2020-12-13 23:26:21 +00:00
|
|
|
style={{ margin: '0px 5px 0 2px', verticalAlign: 'middle', color: isRotationSet ? primaryTextColor : undefined }}
|
2020-04-18 06:50:56 +00:00
|
|
|
title={`${t('Set output rotation. Current: ')} ${isRotationSet ? rotationStr : t('Don\'t modify')}`}
|
|
|
|
onClick={increaseRotation}
|
|
|
|
role="button"
|
|
|
|
/>
|
2020-12-13 23:26:21 +00:00
|
|
|
</>
|
2020-04-18 06:50:56 +00:00
|
|
|
)}
|
2020-02-26 03:11:28 +00:00
|
|
|
|
2020-12-11 20:29:40 +00:00
|
|
|
{!simpleMode && (
|
|
|
|
<FaTrashAlt
|
|
|
|
title={t('Delete source file')}
|
|
|
|
style={{ padding: '5px 10px' }}
|
|
|
|
size={16}
|
|
|
|
onClick={deleteSource}
|
|
|
|
role="button"
|
|
|
|
/>
|
|
|
|
)}
|
2020-02-26 03:11:28 +00:00
|
|
|
|
2020-04-18 06:50:56 +00:00
|
|
|
{hasVideo && (
|
|
|
|
<>
|
2020-12-11 20:29:40 +00:00
|
|
|
{!simpleMode && renderCaptureFormatButton({ height: 20 })}
|
2020-02-26 03:11:28 +00:00
|
|
|
|
2020-04-18 06:50:56 +00:00
|
|
|
<IoIosCamera
|
|
|
|
style={{ paddingLeft: 5, paddingRight: 15 }}
|
|
|
|
size={25}
|
|
|
|
title={t('Capture frame')}
|
|
|
|
onClick={capture}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)}
|
2020-02-26 03:11:28 +00:00
|
|
|
|
2020-12-11 20:29:40 +00:00
|
|
|
{!simpleMode && <ToggleExportConfirm style={{ marginRight: 5 }} exportConfirmEnabled={exportConfirmEnabled} toggleExportConfirmEnabled={toggleExportConfirmEnabled} />}
|
2020-11-29 23:06:06 +00:00
|
|
|
|
2020-11-25 20:46:03 +00:00
|
|
|
<ExportButton outSegments={outSegments} areWeCutting={areWeCutting} autoMerge={autoMerge} onClick={onExportPress} />
|
2020-02-26 03:11:28 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
export default RightMenu;
|