Skip to content

Commit 0c5a6c5

Browse files
committedNov 14, 2024
Destructure deps
1 parent 127ab17 commit 0c5a6c5

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed
 

‎packages/perseus/src/article-renderer.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ class ArticleRenderer
173173
// translatable strings found on Crowdin when rendering articles in
174174
// the WYSIWYG mode for translation. This is needed for the jipt.js
175175
// integration in order to attribute the rendered strings on Crowdin.
176-
if (getDependencies().JIPT.useJIPT) {
176+
const {JIPT} = getDependencies();
177+
if (JIPT.useJIPT) {
177178
const paragraphs: Array<PerseusRenderer> = [];
178179

179180
for (const section of sections) {

‎packages/perseus/src/components/graphie-movables.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ const Label: any = GraphieClasses.createSimpleClass((graphie, props) => {
125125
coord = graphie.unscalePoint(coord);
126126
}
127127
let elem = null;
128-
const deps = getDependencies();
128+
const {JIPT} = getDependencies();
129129

130130
// If the label is rendered for a locale other than "en", push the label
131131
// element to an array. This array is used to lookup the label element
132132
// and processed with jipt('just in place translation', crowdin specific
133133
// program) to replace the passed in crowdin string with the translated
134134
// string. For "en" locale, the jipt processing is skipped.
135-
if (deps.JIPT.useJIPT) {
135+
if (JIPT.useJIPT) {
136136
elem = graphie.label(
137137
coord,
138138
props.text,
@@ -141,7 +141,7 @@ const Label: any = GraphieClasses.createSimpleClass((graphie, props) => {
141141
props.style,
142142
);
143143

144-
deps.JIPT.graphieMovablesJiptLabels.addLabel(elem, props.tex);
144+
JIPT.graphieMovablesJiptLabels.addLabel(elem, props.tex);
145145
} else {
146146
elem = graphie.label(
147147
coord,

‎packages/perseus/src/renderer.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,10 @@ class Renderer
908908
props: Props,
909909
state: State,
910910
): boolean => {
911+
const {JIPT} = getDependencies();
911912
// TODO(aria): Pass this in via webapp as an apiOption
912913
return (
913-
getDependencies().JIPT.useJIPT &&
914+
JIPT.useJIPT &&
914915
state.jiptContent == null &&
915916
props.content.indexOf("crwdns") !== -1
916917
);

0 commit comments

Comments
 (0)
Please sign in to comment.