Skip to content

Commit

Permalink
feat(frontend/settings): combine vishraam color toggles (#561)
Browse files Browse the repository at this point in the history
Fixes #371
  • Loading branch information
bhajneet authored May 29, 2020
1 parent e9b1c95 commit 719b072
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
6 changes: 3 additions & 3 deletions app/frontend/src/Presenter/Line.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@
}

.heavy.vishraams.line .gurmukhi .word.heavy,
.heavy.vishraams.line .vishraams.transliteration .word.heavy {
.heavy.vishraams.line .transliteration .word.heavy {
color: var(--display-vishraam-heavy-color) !important;
}

.medium.vishraams.line .gurmukhi .word.medium,
.medium.vishraams.line .vishraams.transliteration .word.medium {
.medium.vishraams.line .transliteration .word.medium {
color: var(--display-vishraam-medium-color) !important;
}

.light.vishraams.line .gurmukhi .word.light,
.light.vishraams.line .vishraams.transliteration .word.light {
.light.vishraams.line .transliteration .word.light {
color: var(--display-vishraam-light-color) !important;
}

Expand Down
7 changes: 1 addition & 6 deletions app/frontend/src/Presenter/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const isString = ( [ , arg ] ) => typeof arg === 'string'
* @param {boolean} larivaarGurbani Whether Gurbani should be continuous or not.
* @param {boolean} larivaarAssist If `larivaarGurbani`, whether alternate words should be coloured.
* @param {boolean} vishraamColors Enables colors for vishraams.
* @param {boolean} vishraamTransliterationColors Enables colors for vishraams in transliteration.
* @param {boolean} vishraamCharacters Enables display of vishraam characters.
* @param {boolean} vishraamLight Enables colors for light vishraams.
* @param {boolean} vishraamMedium Enables colors for medium vishraams.
Expand Down Expand Up @@ -64,7 +63,6 @@ const Line = ( {
larivaarGurbani: larivaar,
larivaarAssist,
vishraamColors: vishraams,
vishraamTransliterationColors,
vishraamCharacters,
vishraamLight,
vishraamMedium,
Expand Down Expand Up @@ -128,7 +126,7 @@ const Line = ( {
{transliterations.filter( isString ).map( ( [ name, transliteration, fontSize ] ) => (
<CSSTransition key={transliteration} classNames="fade" timeout={0}>
<p
className={classNames( { vishraams: vishraams && vishraamTransliterationColors }, name, 'transliteration' )}
className={classNames( name, 'transliteration' )}
style={{ fontSize: `${fontSize}em` }}
>
{classifyWords( transliteration, !vishraamCharacters ).map(
Expand Down Expand Up @@ -158,7 +156,6 @@ Line.propTypes = {
larivaarGurbani: bool,
larivaarAssist: bool,
vishraamColors: bool,
vishraamTransliterationColors: bool,
vishraamCharacters: bool,
vishraamLight: bool,
vishraamMedium: bool,
Expand All @@ -181,7 +178,6 @@ const {
larivaarAssist,
larivaarGurbani,
vishraamColors,
vishraamTransliterationColors,
vishraamCharacters,
vishraamHeavy,
vishraamMedium,
Expand Down Expand Up @@ -213,7 +209,6 @@ Line.defaultProps = {
larivaarGurbani,
larivaarAssist,
vishraamColors,
vishraamTransliterationColors,
vishraamCharacters,
vishraamHeavy,
vishraamMedium,
Expand Down
4 changes: 1 addition & 3 deletions app/frontend/src/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ export const OPTIONS = {
vishraamMedium: { name: 'Secondary Pause', icon: faPauseCircle, type: OPTION_TYPES.toggle, privacy: PRIVACY_TYPES.local },
vishraamLight: { name: 'Tertiary Pause', icon: faPauseCircle, type: OPTION_TYPES.toggle, privacy: PRIVACY_TYPES.local },
vishraamCharacters: { name: 'Show Symbols', icon: faSubscript, type: OPTION_TYPES.toggle, privacy: PRIVACY_TYPES.local },
vishraamColors: { name: 'Gurmukhi Colors', icon: faFill, type: OPTION_TYPES.toggle, privacy: PRIVACY_TYPES.local },
vishraamTransliterationColors: { name: 'Transliteration Colors', icon: faFill, type: OPTION_TYPES.toggle, privacy: PRIVACY_TYPES.local },
vishraamColors: { name: 'Show Colors', icon: faFill, type: OPTION_TYPES.toggle, privacy: PRIVACY_TYPES.local },
displayAnalytics: { name: 'Display Usage Analytics', icon: faChartPie, type: OPTION_TYPES.toggle, privacy: PRIVACY_TYPES.local },
private: { name: 'Private Settings', icon: faLock, type: OPTION_TYPES.toggle, privacy: PRIVACY_TYPES.private },
launchOnStartup: { name: 'Launch On Startup', icon: faDoorOpen, type: OPTION_TYPES.toggle, privacy: PRIVACY_TYPES.global },
Expand Down Expand Up @@ -244,7 +243,6 @@ export const DEFAULT_OPTIONS = {
vishraamMedium: true,
vishraamLight: true,
vishraamColors: true,
vishraamTransliterationColors: true,
vishraamCharacters: false,
},
sources: {},
Expand Down

0 comments on commit 719b072

Please sign in to comment.