Skip to content

Commit

Permalink
Support RTL for OHEBGRK (#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcouch-sil authored Sep 13, 2024
2 parents 7f78f35 + be9689d commit 7dbecd2
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import {
MarginalRef,
} from '@biblionexus-foundation/platform-editor';
import { Usj } from '@biblionexus-foundation/scripture-utilities';
import { VerseRef } from '@sillsdev/scripture';
import { Canon, VerseRef } from '@sillsdev/scripture';
import { JSX, useCallback, useEffect, useMemo, useRef } from 'react';
import type { WebViewProps } from '@papi/core';
import { logger } from '@papi/frontend';
import { useProjectData } from '@papi/frontend/react';
import { useProjectData, useProjectSetting } from '@papi/frontend/react';
import { ScriptureReference, debounce } from 'platform-bible-utils';
import { Button } from 'platform-bible-react';

Expand Down Expand Up @@ -172,13 +172,15 @@ globalThis.webViewComponent = function PlatformScriptureEditor({
};
}, [scrRef]);

const [projectName] = useProjectSetting(projectId, 'platform.name', '');

const options = useMemo<EditorOptions>(
() => ({
isReadonly: isReadOnly,
hasSpellCheck: false,
textDirection: 'ltr',
textDirection: projectName === 'OHEBGRK' && Canon.isBookOT(scrRef.bookNum) ? 'rtl' : 'ltr',
}),
[isReadOnly],
[isReadOnly, projectName, scrRef],
);

return (
Expand Down

0 comments on commit 7dbecd2

Please sign in to comment.