Extract DuplicatesBox
This commit is contained in:
parent
98e686731e
commit
a1be829b1c
4 changed files with 30 additions and 24 deletions
29
public/components/dups/duplicates-box.js
Normal file
29
public/components/dups/duplicates-box.js
Normal 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
0
public/dist/.gitkeep
vendored
Normal 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({
|
||||
|
|
Loading…
Reference in a new issue