From a1be829b1c5cfbc5238a8acd175a7b29e2385a4a Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 23 Apr 2016 01:59:06 +0200 Subject: [PATCH] Extract DuplicatesBox --- .../{Duplicate.js => dups/duplicate.js} | 0 public/components/dups/duplicates-box.js | 29 +++++++++++++++++++ public/dist/.gitkeep | 0 public/script.jsx | 25 +--------------- 4 files changed, 30 insertions(+), 24 deletions(-) rename public/components/{Duplicate.js => dups/duplicate.js} (100%) create mode 100644 public/components/dups/duplicates-box.js create mode 100644 public/dist/.gitkeep diff --git a/public/components/Duplicate.js b/public/components/dups/duplicate.js similarity index 100% rename from public/components/Duplicate.js rename to public/components/dups/duplicate.js diff --git a/public/components/dups/duplicates-box.js b/public/components/dups/duplicates-box.js new file mode 100644 index 0000000..2e826b5 --- /dev/null +++ b/public/components/dups/duplicates-box.js @@ -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 ( + + ); + }); + return ( + + {duplicates} + + ); + } + else { + return ( +

No duplicate found

+ ); + } + } +}); + +module.exports = DuplicatesBox; diff --git a/public/dist/.gitkeep b/public/dist/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/script.jsx b/public/script.jsx index d214513..6e8545e 100644 --- a/public/script.jsx +++ b/public/script.jsx @@ -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 ( - - ); - }); - return ( - - {duplicates} - - ); - } - else { - return ( -

No duplicate found

- ); - } - } -}); +var DuplicatesBox = require('./components/dups/duplicates-box'); var PlaylistBox = React.createClass({