From 5da188fcd0b0fe6c5470fd8e38c310b9736ee65d Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Fri, 22 Apr 2016 00:12:57 +0200 Subject: [PATCH] Use React Bootstrap --- public/index.html | 1 + public/script.js | 91 +++++++++++++++++++++++------------------------ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/public/index.html b/public/index.html index 7ea9863..668308a 100644 --- a/public/index.html +++ b/public/index.html @@ -16,6 +16,7 @@ + diff --git a/public/script.js b/public/script.js index aa8208e..254c704 100644 --- a/public/script.js +++ b/public/script.js @@ -16,6 +16,7 @@ function getHashParams() { var Duplicate = React.createClass({ render: function () { + var ListGroupItem = ReactBootstrap.ListGroupItem; var authors = ""; this.props.track.artists.forEach(function (item, index) { if (index != 0) { @@ -24,13 +25,14 @@ var Duplicate = React.createClass({ authors += item.name; }); return ( -
{this.props.track.name} - {authors}
+ {this.props.track.name} - {authors} ); } }); 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 ( @@ -38,9 +40,9 @@ var DuplicatesBox = React.createClass({ ); }); return ( -
+ {duplicates} -
+ ); } else { @@ -63,8 +65,9 @@ var PlaylistBox = React.createClass({ this.props.handleClick(id, uid); }, render: function () { + var ListGroup = ReactBootstrap.ListGroup; var currentId = this.state.currentId; - var playlists; + var playlists =

No playlist found.

; if (this.props.playlists) { playlists = this.props.playlists.map(function (pl) { var id = pl.id; @@ -75,9 +78,9 @@ var PlaylistBox = React.createClass({ }, this); } return ( -
+ {playlists} -
+ ); } }); @@ -125,30 +128,35 @@ var DuplicateFinderBox = React.createClass({ }, render: function () { var duplicates; + var Col = ReactBootstrap.Col, + Row = ReactBootstrap.Row; + if (this.state.clicked) { duplicates =

Loading...

; if (!this.state.dupsLoading) { duplicates = ; } duplicates = ( -
+

Duplicates

{duplicates} -
+ ) } + var playlistBox =

Loading...

; if (!this.props.playlistsLoading) { playlistBox = ; } + return ( -
-
+ +

Playlists

{playlistBox} -
+ {duplicates} -
+ ); } }); @@ -175,50 +183,41 @@ var Authenticate = React.createClass({ }, render: function () { var auth; + var Nav = ReactBootstrap.Nav, + NavItem = ReactBootstrap.NavItem, + Navbar = ReactBootstrap.Navbar; + if (this.props.auth.access_token == null) { auth = ( - + ); } else { auth = ( - + ); } return ( - + + + + Duplicate Finder + + + + + + {auth} + + ); } });