mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-13 05:48:36 +03:00
translations always show over video
This commit is contained in:
@@ -5,7 +5,7 @@ import Md from './Md'
|
||||
import Spinner from '../presentational/Spinner'
|
||||
import NoSource from '../presentational/NoSource'
|
||||
|
||||
export default ({ media, viewIdx }) => {
|
||||
export default ({ media, viewIdx, translations, switchLanguage, langIdx }) => {
|
||||
const el = document.querySelector(`.source-media-gallery`)
|
||||
const shiftW = el ? el.getBoundingClientRect().width : 0
|
||||
|
||||
@@ -26,6 +26,15 @@ export default ({ media, viewIdx }) => {
|
||||
case 'Video':
|
||||
return (
|
||||
<div className='media-player'>
|
||||
<div className='banner-trans right-overlay'>
|
||||
{translations ? translations.map((trans, idx) => (
|
||||
langIdx !== idx + 1 ? (
|
||||
<div className='trans-button' onClick={() => switchLanguage(idx + 1)}>{trans.code}</div>
|
||||
) : (
|
||||
<div className='trans-button' onClick={() => switchLanguage(0)}>EN</div>
|
||||
)
|
||||
)) : null}
|
||||
</div>
|
||||
<Player
|
||||
poster={poster}
|
||||
className='source-video'
|
||||
|
||||
@@ -49,19 +49,16 @@ class SourceOverlay extends React.Component {
|
||||
|
||||
<h3 className='mo-banner-content'>{shortenedTitle}</h3>
|
||||
|
||||
<div className='banner-trans'>
|
||||
{this.props.translations ? this.props.translations.map((trans, idx) => (
|
||||
this.state.langIdx !== idx + 1 ? (
|
||||
<div className='trans-button' onClick={() => this.switchLanguage(idx + 1)}>{trans.code}</div>
|
||||
) : (
|
||||
<div className='trans-button' onClick={() => this.switchLanguage(0)}>EN</div>
|
||||
)
|
||||
)) : null}
|
||||
</div>
|
||||
</div>
|
||||
<div className='mo-container' onClick={e => e.stopPropagation()}>
|
||||
<div className='mo-media-container'>
|
||||
<Content media={paths.map(p => selectTypeFromPathWithPoster(p, poster))} viewIdx={this.state.mediaIdx} />
|
||||
<Content
|
||||
switchLanguage={(lang) => this.switchLanguage(lang)}
|
||||
translations={this.props.translations}
|
||||
langIdx={this.state.langIdx}
|
||||
media={paths.map(p => selectTypeFromPathWithPoster(p, poster))}
|
||||
viewIdx={this.state.mediaIdx}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user