From 75e6743f3e2b299f26a30f8df1e2264002f033a1 Mon Sep 17 00:00:00 2001 From: sujitv19196 Date: Sun, 10 Sep 2023 19:57:35 -0500 Subject: [PATCH] move edit file info button next to download and move save button up --- src/screens/EPub/components/EPubHeader/EPubTitle.js | 13 +++++-------- .../EPub/components/EPubHeader/EPubToolbar.js | 7 ++++++- .../EPub/components/EPubHeader/ViewDropdown.js | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/screens/EPub/components/EPubHeader/EPubTitle.js b/src/screens/EPub/components/EPubHeader/EPubTitle.js index 5c9df966b..cbf3e7cff 100644 --- a/src/screens/EPub/components/EPubHeader/EPubTitle.js +++ b/src/screens/EPub/components/EPubHeader/EPubTitle.js @@ -3,7 +3,7 @@ import { CTHeading, CTFragment,useCTConfirmation } from 'layout'; import { connectWithRedux } from '../../controllers'; import EPubCopyModal from '../EPubCopyModal'; import SaveStatusLabel from './SaveStatusLabel'; -import { _makeTBtn } from './ToolButton'; +import { ToolButtonDivider, _makeTBtn } from './ToolButton'; function EPubTitle({ epub, dispatch }) { const { title } = epub; @@ -11,11 +11,6 @@ function EPubTitle({ epub, dispatch }) { const onOpenCpyMdl = () => setShowCpyMdl(true); const onCloseCpyMdl = () => setShowCpyMdl(false); - const onOpenSettings = () => dispatch({ type: 'epub/setShowFileSettings', payload: true }); - - const settingsBtn = _makeTBtn( - 'edit', 'Edit file', null, onOpenSettings, false, true - ); const copyBtn = _makeTBtn( 'file_copy', 'Make a copy', null, onOpenCpyMdl, false, true ); @@ -30,7 +25,8 @@ function EPubTitle({ epub, dispatch }) { 'delete', 'Delete', null, delConfirmation.onOpen, false, true ); - + const saveEPub = () => dispatch({ type: 'epub/updateEPub_Internal' }) + const saveBtnEl = _makeTBtn('cloud_upload', 'Save', '⌘S', saveEPub, false, true); return ( @@ -38,9 +34,10 @@ function EPubTitle({ epub, dispatch }) { {title} - {settingsBtn} + {copyBtn} {deleteBtn} + {saveBtnEl} diff --git a/src/screens/EPub/components/EPubHeader/EPubToolbar.js b/src/screens/EPub/components/EPubHeader/EPubToolbar.js index a88fbafef..e7f776e4f 100644 --- a/src/screens/EPub/components/EPubHeader/EPubToolbar.js +++ b/src/screens/EPub/components/EPubHeader/EPubToolbar.js @@ -53,12 +53,17 @@ function EPubToolbar({ view, dispatch, epub }) { 'help_outline', 'Show Help Guide', null, openHelpGuide, false, true ); + const onOpenSettings = () => dispatch({ type: 'epub/setShowFileSettings', payload: true }); + + const settingsBtn = _makeTBtn( + 'edit', 'Edit I-Note Info', null, onOpenSettings, false, true + ); return ( - {saveBtnEl} {null && previewBtnEl} {/* The preview button causes a crash when clicked (cause unknown) */} + {settingsBtn} {!isReadOnly && } diff --git a/src/screens/EPub/components/EPubHeader/ViewDropdown.js b/src/screens/EPub/components/EPubHeader/ViewDropdown.js index 4beadb0ac..f2d89b4e5 100644 --- a/src/screens/EPub/components/EPubHeader/ViewDropdown.js +++ b/src/screens/EPub/components/EPubHeader/ViewDropdown.js @@ -30,7 +30,7 @@ function ViewDropdown({ view, dispatch }) { }, { value: epub.const.EditINote, - text: 'Edit INote (beta)', + text: 'Edit I-Note (beta)', icon: 'edit' } ];