From c51fe26cccf452d18a464ca4e4568cbcb564fab8 Mon Sep 17 00:00:00 2001 From: sijumoncy <72241997+sijumoncy@users.noreply.github.com> Date: Wed, 29 May 2024 09:20:31 +0530 Subject: [PATCH] all panes changed with icons --- .../EditorPage/AudioEditor/AudioEditor.js | 5 +- .../EditorPage/ObsEditor/EditorPanel.js | 13 ++-- .../Reference/Audio/ReferenceAudio.js | 4 ++ .../Reference/OBS/ObsResourceCard.js | 8 ++- .../EditorPage/Reference/OBS/ObsTn.js | 2 + .../EditorPage/Reference/OBS/ObsTwlCard.js | 2 + .../ReferenceBible/ReferenceBibleX.js | 2 + .../components/MenuDropdown/MenuDropdown.js | 16 +++-- renderer/src/layouts/editor/EditorSection.js | 59 +++++++++++++++++-- .../src/layouts/editor/SectionPlaceholder1.js | 26 +++++++- .../src/layouts/editor/SectionPlaceholder2.js | 28 ++++++++- renderer/src/layouts/editor/WebMenuBar.js | 2 +- 12 files changed, 140 insertions(+), 27 deletions(-) diff --git a/renderer/src/components/EditorPage/AudioEditor/AudioEditor.js b/renderer/src/components/EditorPage/AudioEditor/AudioEditor.js index 274f4f5be..427c30bb9 100644 --- a/renderer/src/components/EditorPage/AudioEditor/AudioEditor.js +++ b/renderer/src/components/EditorPage/AudioEditor/AudioEditor.js @@ -31,7 +31,7 @@ const AudioEditor = ({ editor }) => { audioContent, audioPath, selectedFont, - fontSize, + editorFontSize, // eslint-disable-next-line no-unused-vars updateWave, // updateWave is used to update the waveform in the Editor after recording audio }, actions: { @@ -40,6 +40,7 @@ const AudioEditor = ({ editor }) => { setAudioContent, setAudioCurrentChapter, setAudioPath, + setEditorFontSize, }, } = useContext(ReferenceContext); @@ -219,7 +220,7 @@ const AudioEditor = ({ editor }) => { verse={verse} location={audioPath} updateWave={updateWave} - fontSize={fontSize} + fontSize={editorFontSize} selectedFont={selectedFont} /> )} diff --git a/renderer/src/components/EditorPage/ObsEditor/EditorPanel.js b/renderer/src/components/EditorPage/ObsEditor/EditorPanel.js index 3dee90440..61bda0a19 100644 --- a/renderer/src/components/EditorPage/ObsEditor/EditorPanel.js +++ b/renderer/src/components/EditorPage/ObsEditor/EditorPanel.js @@ -8,12 +8,13 @@ const EditorPanel = ({ obsStory, storyUpdate }) => { const { state: { selectedFont, - fontSize, + editorFontSize, }, actions: { setSelectedStory, }, } = useContext(ReferenceContext); + const { states: { scrollLock } } = useContext(ProjectContext); const { t } = useTranslation(); const handleChange = (e) => { @@ -90,7 +91,7 @@ const EditorPanel = ({ obsStory, storyUpdate }) => { className="flex-grow text-justify ml-2 p-2 text-xl" style={{ fontFamily: selectedFont || 'sans-serif', - fontSize: `${fontSize}rem`, + fontSize: `${editorFontSize}rem`, }} /> @@ -118,8 +119,8 @@ const EditorPanel = ({ obsStory, storyUpdate }) => { onInput={(e) => handleAutoHeight(e)} style={{ fontFamily: selectedFont || 'sans-serif', - fontSize: `${fontSize}rem`, - lineHeight: (fontSize > 1.3) ? 1.5 : '', + fontSize: `${editorFontSize}rem`, + lineHeight: (editorFontSize > 1.3) ? 1.5 : '', }} /> @@ -140,8 +141,8 @@ const EditorPanel = ({ obsStory, storyUpdate }) => { className="flex-grow text-justify ml-2 p-2 text-sm" style={{ fontFamily: selectedFont || 'sans-serif', - fontSize: `${fontSize}rem`, - lineHeight: (fontSize > 1.3) ? 1.5 : '', + fontSize: `${editorFontSize}rem`, + lineHeight: (editorFontSize > 1.3) ? 1.5 : '', }} /> diff --git a/renderer/src/components/EditorPage/Reference/Audio/ReferenceAudio.js b/renderer/src/components/EditorPage/Reference/Audio/ReferenceAudio.js index cda21beb9..e9be9002b 100644 --- a/renderer/src/components/EditorPage/Reference/Audio/ReferenceAudio.js +++ b/renderer/src/components/EditorPage/Reference/Audio/ReferenceAudio.js @@ -25,6 +25,8 @@ const ReferenceAudio = ({ chapter, verse, bookId, + font, + fontSize, }) => { const { actions: { @@ -227,6 +229,8 @@ const ReferenceAudio = ({ data={bookData} versepath={mp3Path} verse={verse} + font={font} + fontSize={fontSize} // goToVerse={{ // chapter: parseInt(chapter, 10), // verse: parseInt(verse, 10), diff --git a/renderer/src/components/EditorPage/Reference/OBS/ObsResourceCard.js b/renderer/src/components/EditorPage/Reference/OBS/ObsResourceCard.js index 5890d1168..6d97e2069 100644 --- a/renderer/src/components/EditorPage/Reference/OBS/ObsResourceCard.js +++ b/renderer/src/components/EditorPage/Reference/OBS/ObsResourceCard.js @@ -17,6 +17,7 @@ function ObsResourceCard({ isLoading, setIndex, font, + fontSize, }) { const { state: { filters, markdownView }, @@ -36,7 +37,12 @@ function ObsResourceCard({ itemIndex={index} setItemIndex={setIndex} /> -
+
1.3) ? 1.5 : '', + }} + > setIndex(v)} font={font} + fontSize={fontSize} /> ) : ); diff --git a/renderer/src/components/EditorPage/Reference/OBS/ObsTwlCard.js b/renderer/src/components/EditorPage/Reference/OBS/ObsTwlCard.js index 8c226d1f5..63654c297 100644 --- a/renderer/src/components/EditorPage/Reference/OBS/ObsTwlCard.js +++ b/renderer/src/components/EditorPage/Reference/OBS/ObsTwlCard.js @@ -23,6 +23,7 @@ function ObsTwlCard({ resourceId, offlineResource, font, + fontSize, ...props }) { const [index, setIndex] = useState(1); @@ -104,6 +105,7 @@ function ObsTwlCard({ index={index} setIndex={(v) => setIndex(v)} font={font} + fontSize={fontSize} /> ) : ( diff --git a/renderer/src/components/EditorPage/Reference/ReferenceBible/ReferenceBibleX.js b/renderer/src/components/EditorPage/Reference/ReferenceBible/ReferenceBibleX.js index 472e791c1..5ff7a6c7c 100644 --- a/renderer/src/components/EditorPage/Reference/ReferenceBible/ReferenceBibleX.js +++ b/renderer/src/components/EditorPage/Reference/ReferenceBible/ReferenceBibleX.js @@ -13,6 +13,7 @@ const ReferenceBibleX = ({ refName, bookId, font, + fontSize, }) => { const { states: { @@ -47,6 +48,7 @@ const ReferenceBibleX = ({ refName, scrollLock, font, + fontSize, }; return ( <> diff --git a/renderer/src/components/MenuDropdown/MenuDropdown.js b/renderer/src/components/MenuDropdown/MenuDropdown.js index b46e21be0..bbcf91959 100644 --- a/renderer/src/components/MenuDropdown/MenuDropdown.js +++ b/renderer/src/components/MenuDropdown/MenuDropdown.js @@ -14,7 +14,7 @@ import { } from 'font-detect-rhl'; export default function MenuDropdown({ - selectedFont, setSelectedFont, buttonStyle, + selectedFont, setSelectedFont, buttonStyle, showIcon = true, }) { const detectedFonts = useDetectFonts({ fonts: fontsArray }); const [query, setQuery] = useState(''); @@ -37,12 +37,16 @@ export default function MenuDropdown({ { + if (status === 'dec' && fontSize > 0.70) { + setFontsize(fontSize - 0.2); + } + if (status === 'inc' && fontSize < 2) { + setFontsize(fontSize + 0.2); + } + }; + const addRow = () => { if (sectionNum >= 0 && sectionNum < 2) { setSectionNum(sectionNum + 1); @@ -224,7 +234,10 @@ export default function EditorSection({ /> )} -
+
{title}
@@ -233,14 +246,20 @@ export default function EditorSection({ {scrollLock && title ? ( <> {CustomNavigation} -
+
{title}
) : (
-
+
{title}
@@ -248,10 +267,40 @@ export default function EditorSection({ )} )} -
+
+ + +