Skip to content

Commit

Permalink
QF-1426 wbw (#2261)
Browse files Browse the repository at this point in the history
* Enable word by word for all users and enable it for reading view

* Always enable Ayah menu for reading view (#2262)
  • Loading branch information
osamasayed authored Dec 17, 2024
1 parent b28ced8 commit de619a4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/components/dls/QuranWord/QuranWord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ const QuranWord = ({
1. When the current character is of type Word.
2. When it's allowed to have word by word (won't be allowed for search results as of now).
3. When the tooltip settings are set to either translation or transliteration or both.
3. When in translation view: the tooltip settings are set to either translation or transliteration or both.
When in reading view: always show tooltip.
*/
const showTooltip =
word.charTypeName === CharType.Word && isWordByWordAllowed && !!showTooltipFor.length;
word.charTypeName === CharType.Word &&
isWordByWordAllowed &&
(readingPreference === ReadingPreference.Translation ? !!showTooltipFor.length : true);
const translationViewTooltipContent = useMemo(
() => (isWordByWordAllowed ? getTooltipText(showTooltipFor, word) : null),
[isWordByWordAllowed, showTooltipFor, word],
Expand Down Expand Up @@ -139,8 +142,7 @@ const QuranWord = ({
}
}, [audioService, isRecitationEnabled, word]);

const shouldHandleWordClicking =
readingPreference === ReadingPreference.Translation && word.charTypeName !== CharType.End;
const shouldHandleWordClicking = word.charTypeName !== CharType.End;

return (
<div
Expand Down
7 changes: 7 additions & 0 deletions src/redux/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,11 @@ export default {
wordClickFunctionality: WordClickFunctionality.NoAudio,
},
}),
34: (state) => ({
...state,
readingPreferences: {
...state.readingPreferences,
wordClickFunctionality: WordClickFunctionality.PlayAudio,
},
}),
};
2 changes: 1 addition & 1 deletion src/redux/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import SliceName from './types/SliceName';

const persistConfig = {
key: 'root',
version: 33,
version: 34,
storage,
migrate: createMigrate(migrations, {
debug: process.env.NEXT_PUBLIC_VERCEL_ENV === 'development',
Expand Down

0 comments on commit de619a4

Please sign in to comment.