Skip to content

Commit

Permalink
fix(frontend/overlay): widen scope of esc class so background can be …
Browse files Browse the repository at this point in the history
…cleared

also add span tags to allow for text only background

close #359
  • Loading branch information
bhajneet committed Jan 12, 2020
1 parent 7c76dbd commit ad46804
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
19 changes: 13 additions & 6 deletions app/frontend/src/Overlay/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,31 @@ const Line = ( {

return (
<div className={classNames( className, {
empty: !gurmukhi,
larivaar,
assist: larivaar && larivaarAssist,
}, 'overlay-line' )}
>
<p className="gurmukhi">{line}</p>
<p className="gurmukhi">
<span className="text">
{line}
</span>
</p>

{translations.filter( isNonEmptyString ).map( ( [ name, translation ] ) => (
<p key={`${name}-${translation}`} className={classNames( name, 'translation' )}>
{translation}
<span className="text">
{translation}
</span>
</p>
) )}

{transliterations.filter( isNonEmptyString ).map( ( [ name, transliteration ] ) => (
<p key={`${name}-${transliteration}`} className={classNames( name, 'transliteration' )}>
{classifyWords( transliteration, true ).map(
( { word, type }, i ) => <span key={`${word}-${type}-${i}`} className={classNames( type, 'word' )}>{word}</span>,
)}
<span className="text">
{classifyWords( transliteration, true ).map(
( { word, type }, i ) => <span key={`${word}-${type}-${i}`} className={classNames( type, 'word' )}>{word}</span>,
)}
</span>
</p>
) )}

Expand Down
6 changes: 5 additions & 1 deletion app/frontend/src/Overlay/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useContext } from 'react'
import classNames from 'classnames'

import Line from './Line'
import ThemeLoader from './ThemeLoader'
Expand Down Expand Up @@ -41,7 +42,10 @@ const Overlay = () => {
const getTransliterationFor = languageId => getTransliteration( line, languageId )

return (
<div className="overlay">
<div className={classNames( {
empty: !line,
}, 'overlay' )}
>
<ThemeLoader connected={connected} name={overlayName} />
<Line
simpleGraphics
Expand Down

0 comments on commit ad46804

Please sign in to comment.