lossless-cut/src/RightMenu.jsx

68 wiersze
2.2 KiB
React
Czysty Zwykły widok Historia

import React, { memo } from 'react';
import { IoIosCamera } from 'react-icons/io';
import { FaTrashAlt } from 'react-icons/fa';
import { MdRotate90DegreesCcw } from 'react-icons/md';
import { useTranslation } from 'react-i18next';
import { primaryTextColor } from './colors';
import ExportButton from './components/ExportButton';
import ToggleExportConfirm from './components/ToggleExportConfirm';
const RightMenu = memo(({
2020-12-14 15:18:47 +00:00
isRotationSet, rotation, areWeCutting, increaseRotation, cleanupFiles, renderCaptureFormatButton,
capture, onExportPress, outSegments, hasVideo, autoMerge, exportConfirmEnabled, toggleExportConfirmEnabled,
2020-12-11 20:29:40 +00:00
simpleMode,
}) => {
const rotationStr = `${rotation}°`;
const { t } = useTranslation();
return (
<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-12-11 20:29:40 +00:00
{!simpleMode && (
<FaTrashAlt
2020-12-14 15:18:47 +00:00
title={t('Close file and clean up')}
2020-12-11 20:29:40 +00:00
style={{ padding: '5px 10px' }}
size={16}
2020-12-14 15:18:47 +00:00
onClick={cleanupFiles}
2020-12-11 20:29:40 +00:00
role="button"
/>
)}
2020-04-18 06:50:56 +00:00
{hasVideo && (
<>
2020-12-11 20:29:40 +00:00
{!simpleMode && renderCaptureFormatButton({ height: 20 })}
2020-04-18 06:50:56 +00:00
<IoIosCamera
style={{ paddingLeft: 5, paddingRight: 15 }}
size={25}
title={t('Capture frame')}
onClick={capture}
/>
</>
)}
2020-12-11 20:29:40 +00:00
{!simpleMode && <ToggleExportConfirm style={{ marginRight: 5 }} exportConfirmEnabled={exportConfirmEnabled} toggleExportConfirmEnabled={toggleExportConfirmEnabled} />}
<ExportButton outSegments={outSegments} areWeCutting={areWeCutting} autoMerge={autoMerge} onClick={onExportPress} />
</div>
);
});
export default RightMenu;