Skip to content

Commit

Permalink
Merge pull request #754 from sevenxhq/fix/verse-edit
Browse files Browse the repository at this point in the history
Fixed verse edit bleeding into verse number
  • Loading branch information
vipinpaul authored Jan 19, 2023
2 parents 78cf9ad + 31040e0 commit 5d76bb9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
36 changes: 30 additions & 6 deletions renderer/src/components/EditorPage/Scribex/Buttons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import {
RectangleStackIcon,
PencilIcon,
ArrowDownOnSquareIcon,
Bars2Icon,
Bars4Icon,
ArrowUturnLeftIcon,
ArrowUturnRightIcon

} from '@heroicons/react/24/outline';

import { ArrowClockwise, ArrowCounterClockwise } from 'phosphor-react';
Expand Down Expand Up @@ -54,35 +59,54 @@ export default function Buttons(props) {
)}
aria-hidden="true"
onClick={onSectionable}
title={sectionable ? "Expand all Chapters" : "Collapse Chapters"}
/>

<PencilIcon
aria-label="Collection-Icon"
aria-label="Pencil-Icon"
className={classNames(
editable ? 'fill-current' : '',
'h-5 mr-2 w-5 text-white cursor-pointer',
)}
aria-hidden="true"
onClick={onEditable}
title={editable ? "Disable Edit" : "Enable Edit"}
/>
{blockable ? <Bars2Icon
aria-label="Article-Icon"
className='h-5 mr-2 w-5 text-white cursor-pointer'
aria-hidden="true"
onClick={onBlockable}
title="Collapse blocks"
/> :
<Bars4Icon
aria-label="List-Icon"
className='h-5 mr-2 w-5 text-white cursor-pointer'
aria-hidden="true"
onClick={onBlockable}
title="Split into blocks"
/>}

<ArrowCounterClockwise
aria-label="Collection-Icon"
<ArrowUturnLeftIcon
aria-label="Undo-Icon"
className="h-5 mr-2 w-5 text-white cursor-pointer"
aria-hidden="true"
onClick={() => undo()}
title={"Undo"}
/>
<ArrowClockwise
aria-label="Collection Icon"
<ArrowUturnRightIcon
aria-label="Redo-Icon"
className="h-5 mr-2 w-5 text-white cursor-pointer"
aria-hidden="true"
onClick={() => redo()}
title="Redo"
/>
<ArrowDownOnSquareIcon
aria-label="Save Icon"
aria-label="Save-Icon"
className="h-5 mr-2 w-5 text-white cursor-pointer"
aria-hidden="true"
onClick={() => exportUsfm(bookCode)}
title="Save"
/>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion renderer/src/components/hooks/scribex/htmlmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const htmlMap = (context) => ({
verses: ({ atts }) => ({
classList: ['mark', 'verse', `verse-${atts.number}`],
id: `ch${context.lastChapter}v${atts.number}`,
tagName: 'a',
tagName: 'span',
}),
},
graft: {
Expand Down
2 changes: 1 addition & 1 deletion renderer/src/util/createVersificationUSFM.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const createVersificationUSFM = (
verses.push({
verseNumber: i.toString(),
verseText: '',
contents: ['...'], // adding default text to verses to mitigate the empty verse bug
contents: ['...'], // adding default text to verses to show the beginning of verse.
});
}
contents = contents.concat(verses);
Expand Down

0 comments on commit 5d76bb9

Please sign in to comment.