Extract DuplicatesBox

This commit is contained in:
Gabriel Augendre 2016-04-23 01:59:06 +02:00
parent 98e686731e
commit a1be829b1c
4 changed files with 30 additions and 24 deletions

View file

@ -0,0 +1,29 @@
'use strict';
var React = require('react');
var ReactBootstrap = require('react-bootstrap');
var Duplicate = require('./duplicate');
var DuplicatesBox = React.createClass({
render: function () {
var ListGroup = ReactBootstrap.ListGroup;
if (this.props.dups && this.props.dups.length > 0) {
var duplicates = this.props.dups.map(function (duplicate) {
return (
<Duplicate track={duplicate.track} key={duplicate.track.id}/>
);
});
return (
<ListGroup>
{duplicates}
</ListGroup>
);
}
else {
return (
<p>No duplicate found</p>
);
}
}
});
module.exports = DuplicatesBox;

0
public/dist/.gitkeep vendored Normal file
View file

View file

@ -20,30 +20,7 @@ function getHashParams() {
return hashParams;
}
var Duplicate = require('./components/Duplicate');
var DuplicatesBox = React.createClass({
render: function () {
var ListGroup = ReactBootstrap.ListGroup;
if (this.props.dups && this.props.dups.length > 0) {
var duplicates = this.props.dups.map(function (duplicate) {
return (
<Duplicate track={duplicate.track} key={duplicate.track.id}/>
);
});
return (
<ListGroup>
{duplicates}
</ListGroup>
);
}
else {
return (
<p>No duplicate found</p>
);
}
}
});
var DuplicatesBox = require('./components/dups/duplicates-box');
var PlaylistBox = React.createClass({