Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated PR to fix bug #1741 (MahaanKoshTooltip Reading mode bug fix) #1743

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions src/js/components/Baani/Baani.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class Baani extends React.PureComponent {
highlight,
showFullScreen,
visraams,
isReadingMode,
} = this.props;

return (
Expand All @@ -248,6 +249,8 @@ class Baani extends React.PureComponent {
fontFamily={fontFamily}
isVisraam={visraams}
visraam={shabad.visraam}
isReadingMode={isReadingMode}
key={shabad.verseId}
/>
);
};
Expand Down Expand Up @@ -884,31 +887,31 @@ class Baani extends React.PureComponent {
const hindiTranslationLanguages = this.getHindiTranslationLanguages();
const spanishTranslationLanguage = translationLanguages.includes('spanish')
const shabads = Object.entries(normalizedGurbani).map(([idx, shabads]) => shabads.map(shabad => shabad)).flat();
let lineIndex = 0;
const { selectedWord, selectedWordIndex, selectedLine } = this.state;
return (
<div>
{shabads.map(shabad => {
return(
<div key={shabad.verseId} className={`${unicode ? 'unicode' : 'gurlipi-reading-mode'}`}>
<BaaniLine
text={shabad.verse}
unicode={unicode}
shouldHighlight={
showFullScreen
? false
: highlight === parseInt(getVerseId(shabad), 10)
}
larivaar={larivaar}
larivaarAssist={larivaarAssist}
fontSize={fontSize}
lineHeight={lineHeight}
fontFamily={fontFamily}
visraams={visraams}
visraam={shabad.visraam}
isReadingMode={isReadingMode}
key={shabad.verseId}
/>
</div>
)
{shabads.map((shabad) => {
lineIndex++;
return (
<div
key={shabad.verseId}
className={`${unicode ? 'unicode' : 'gurlipi-reading-mode'}`}
>
<MahankoshContext.Provider
key={lineIndex}
value={{
currentLine: lineIndex,
selectedLine,
selectedWord,
selectedWordIndex,
setMahankoshInformation: this.setMahankoshInformation,
}}
>
{this.getBaniLine(shabad)}
</MahankoshContext.Provider>
</div>
);
})}
{transliterationLanguages.map((language) => {
return (
Expand Down
51 changes: 6 additions & 45 deletions src/js/components/__tests__/__snapshots__/Meta.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ exports[`<Meta /> <Meta type="hukamnama" /> renders correctly 1`] = `
class="hukamnama-audio hukamnama-audio--shown "
>
<div
aria-label="Audio Player"
class="rhap_container "
aria-label="Audio player"
class="rhap_container rhap_loop--off rhap_play-status--paused "
role="group"
tabindex="0"
>
Expand Down Expand Up @@ -244,7 +244,7 @@ exports[`<Meta /> <Meta type="hukamnama" /> renders correctly 1`] = `
--:--
</div>
<div
aria-label="Audio Progress Control"
aria-label="Audio progress control"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
Expand Down Expand Up @@ -285,60 +285,21 @@ exports[`<Meta /> <Meta type="hukamnama" /> renders correctly 1`] = `
class="rhap_button-clear rhap_main-controls-button rhap_rewind-button"
type="button"
>
<svg
focusable="false"
height="1em"
preserveAspectRatio="xMidYMid meet"
style="transform: rotate(360deg);"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M11.5 12l8.5 6V6m-9 12V6l-8.5 6l8.5 6z"
fill="currentColor"
/>
</svg>
<span />
</button>
<button
aria-label="Play"
class="rhap_button-clear rhap_main-controls-button rhap_play-pause-button"
type="button"
>
<svg
focusable="false"
height="1em"
preserveAspectRatio="xMidYMid meet"
style="transform: rotate(360deg);"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M10 16.5v-9l6 4.5M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2z"
fill="currentColor"
/>
</svg>
<span />
</button>
<button
aria-label="Forward"
class="rhap_button-clear rhap_main-controls-button rhap_forward-button"
type="button"
>
<svg
focusable="false"
height="1em"
preserveAspectRatio="xMidYMid meet"
style="transform: rotate(360deg);"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13 6v12l8.5-6M4 18l8.5-6L4 6v12z"
fill="currentColor"
/>
</svg>
<span />
</button>
</div>
<div
Expand Down