From ed5395ae25beb54e6d4f934be2631aef5fac183c Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sat, 18 Apr 2020 19:24:29 +0800 Subject: [PATCH] improve right menu --- src/App.jsx | 3 ++- src/RightMenu.jsx | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index c2de268d..5d53bb99 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1971,12 +1971,13 @@ const App = memo(() => { isRotationSet={isRotationSet} rotation={rotation} areWeCutting={areWeCutting} + autoMerge={autoMerge} increaseRotation={increaseRotation} deleteSource={deleteSource} renderCaptureFormatButton={renderCaptureFormatButton} capture={capture} cutClick={cutClick} - multipleCutSegments={cutSegments.length > 1} + outSegments={outSegments} /> diff --git a/src/RightMenu.jsx b/src/RightMenu.jsx index 7879c8ce..34acae18 100644 --- a/src/RightMenu.jsx +++ b/src/RightMenu.jsx @@ -10,13 +10,24 @@ import { primaryColor } from './colors'; const RightMenu = memo(({ isRotationSet, rotation, areWeCutting, increaseRotation, deleteSource, renderCaptureFormatButton, - capture, cutClick, multipleCutSegments, hasVideo, + capture, cutClick, outSegments, hasVideo, autoMerge, }) => { const rotationStr = `${rotation}°`; const CutIcon = areWeCutting ? FiScissors : FaFileExport; const { t } = useTranslation(); + let exportButtonTitle = t('Export'); + if (outSegments) { + if (outSegments.length === 1) { + exportButtonTitle = t('Export selection'); + } else if (outSegments.length > 1) { + exportButtonTitle = t('Export {{ num }} segments', { num: outSegments.length }); + } + } + + const exportButtonText = autoMerge && outSegments && outSegments.length > 1 ? t('Export+merge') : t('Export'); + return (
{hasVideo && ( @@ -54,16 +65,16 @@ const RightMenu = memo(({ )} - {t('Export')} + {exportButtonText}
);