diff --git a/src/components/Overlay/Media.js b/src/components/Overlay/Media.js index c5d7146..9c28449 100644 --- a/src/components/Overlay/Media.js +++ b/src/components/Overlay/Media.js @@ -3,10 +3,15 @@ import Content from './Content' import Controls from './Controls' import { selectTypeFromPathWithPoster } from '../../common/utilities' +/* + * Inside the SourceOverlay, both the currently displaying media and language + * can be changed by the user. These are both managed in this component's React + * state. + */ class SourceOverlay extends React.Component { constructor () { super() - this.state = { mediaIdx: 0, transIdx: 0 } + this.state = { mediaIdx: 0, langIdx: 0 } this.onShiftGallery = this.onShiftGallery.bind(this) } @@ -28,8 +33,8 @@ class SourceOverlay extends React.Component { this.setState({ mediaIdx: this.state.mediaIdx + shift }) } - switchToTrans (idx) { - this.setState({ transIdx: idx }) + switchLanguage (idx) { + this.setState({ langIdx: idx }) } renderContent (source) { @@ -46,10 +51,10 @@ class SourceOverlay extends React.Component {