Change when ads display in WordList

This commit is contained in:
Robbie Antenesse 2017-12-16 10:14:04 -07:00
parent 47a9c96c76
commit 3b275ca765
1 changed files with 4 additions and 5 deletions

View File

@ -37,13 +37,12 @@ export class WordsList extends Component {
{this.props.words
&& this.props.words.map((word, index) => {
return (
<div>
{index % adsEveryXWords == 0
&& <LazyLoader lazyLoad={ loadAd } />
<div key={ `word_${word.id}` }>
{index % adsEveryXWords == 1
&& <LazyLoader key={ index } lazyLoad={ loadAd } />
}
<WordDisplay key={ `word_${word.id}` }
word={ word }
<WordDisplay word={ word }
updateDisplay={ this.props.updateDisplay } />
</div>
);