|
1 | 1 | import React, { useEffect, useRef, useState } from 'react';
|
2 | 2 | import PropTypes from 'prop-types';
|
3 |
| -import { useStoreActions, useStoreState } from 'easy-peasy'; |
| 3 | +import { useStoreState } from 'easy-peasy'; |
4 | 4 | import { CSSTransition } from 'react-transition-group';
|
5 | 5 |
|
6 | 6 | import SlideTeeka from './SlideTeeka';
|
@@ -28,8 +28,7 @@ const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => {
|
28 | 28 | content3Visibility,
|
29 | 29 | } = useStoreState((state) => state.userSettings);
|
30 | 30 |
|
31 |
| - const { activeVerseId, disabledContent } = useStoreState((state) => state.navigator); |
32 |
| - const { setDisabledContent } = useStoreActions((state) => state.navigator); |
| 31 | + const { activeVerseId } = useStoreState((state) => state.navigator); |
33 | 32 | const [showVerse, setShowVerse] = useState(true);
|
34 | 33 | const [orderMarkup, setOrderMarkup] = useState(null);
|
35 | 34 |
|
@@ -63,34 +62,13 @@ const Slide = ({ verseObj, nextLineObj, isMiscSlide, bgColor }) => {
|
63 | 62 |
|
64 | 63 | useEffect(() => {
|
65 | 64 | setTimeout(() => {
|
66 |
| - if (activeVerseRef && activeVerseRef.current.className.includes('active-viewer-verse')) { |
| 65 | + if (activeVerseRef && activeVerseRef.current?.className.includes('active-viewer-verse')) { |
67 | 66 | activeVerseRef.current.scrollIntoView({
|
68 | 67 | behavior: 'smooth',
|
69 | 68 | block: 'center',
|
70 | 69 | });
|
71 | 70 | }
|
72 | 71 | }, 100);
|
73 |
| - if (verseObj && verseObj.Translations) { |
74 |
| - const translations = JSON.parse(verseObj.Translations); |
75 |
| - |
76 |
| - const translationMapping = { |
77 |
| - 'en.bdb': 'translation-english', |
78 |
| - 'es.sn': 'translation-spanish', |
79 |
| - 'hi.ss': 'translation-hindi', |
80 |
| - }; |
81 |
| - |
82 |
| - const missingTranslations = Object.entries(translationMapping) |
83 |
| - .filter(([key]) => { |
84 |
| - const value = key.split('.').reduce((obj, k) => obj && obj[k], translations); |
85 |
| - return !value || !value.trim(); |
86 |
| - }) |
87 |
| - // eslint-disable-next-line no-unused-vars |
88 |
| - .map(([_, identifier]) => identifier); |
89 |
| - |
90 |
| - if (JSON.stringify(disabledContent) !== JSON.stringify(missingTranslations)) { |
91 |
| - setDisabledContent(missingTranslations); |
92 |
| - } |
93 |
| - } |
94 | 72 | }, [verseObj]);
|
95 | 73 |
|
96 | 74 | useEffect(() => {
|
|
0 commit comments