From 5d696055b1ec532e36d9cc6a037afaa9becbf028 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Sat, 30 Dec 2017 11:55:07 +1300 Subject: [PATCH] Sortable modal UI --- src/js/components/Modal/EditRadioModal.js | 2 +- .../components/Modal/SearchURISchemesModal.js | 51 ++++++++---- src/scss/components/_modal.scss | 78 +++++++++++++------ src/scss/global/_core.scss | 5 ++ 4 files changed, 96 insertions(+), 40 deletions(-) diff --git a/src/js/components/Modal/EditRadioModal.js b/src/js/components/Modal/EditRadioModal.js index 8ad914c6..5bbc6fae 100755 --- a/src/js/components/Modal/EditRadioModal.js +++ b/src/js/components/Modal/EditRadioModal.js @@ -168,7 +168,7 @@ export default class EditRadioModal extends React.Component{ {seed.unresolved ? {seed.uri} : {seed.name} } {!seed.unresolved ?  ({seed.type}) : null} ) diff --git a/src/js/components/Modal/SearchURISchemesModal.js b/src/js/components/Modal/SearchURISchemesModal.js index bfb0e3df..c1882646 100755 --- a/src/js/components/Modal/SearchURISchemesModal.js +++ b/src/js/components/Modal/SearchURISchemesModal.js @@ -39,38 +39,61 @@ export default class SearchURISchemesModal extends React.Component{ } render(){ + var unselected_schemes = []; + for (var i = 0; i < this.props.available_uri_schemes.length; i++){ + var scheme = this.props.available_uri_schemes[i]; + if (!this.state.schemes.includes(scheme)){ + unselected_schemes.push(scheme); + } + } + return (

Search sources

-

Customise the providers used when searching. Reduce the number of providers to speed up your searches. Please note that not all backends support searching by artist, album or playlist.

+

Customise the providers used when searching. Reduce the number of providers to speed up your searches.

this.handleSubmit(e)}> { this.setState({schemes: order}) }}> { this.state.schemes.map(scheme => { - return ( -
- + return ( +
+ + {scheme.replace(':','')} +
) }) } +
+

Add more schemes

+ { + unselected_schemes.map(scheme => { + return ( +
this.handleToggle(scheme)}> + {scheme.replace(':','')} +    + +
+ ) + }) + } +
+
diff --git a/src/scss/components/_modal.scss b/src/scss/components/_modal.scss index 1237784a..9faa2ced 100755 --- a/src/scss/components/_modal.scss +++ b/src/scss/components/_modal.scss @@ -104,6 +104,30 @@ } } + .add-uri, + .remove-uri { + position: absolute; + top: 6px; + right: 6px; + padding: 8px; + margin: 0; + min-width: 0; + color: #FFFFFF; + background: transparent; + + &:before { + display: none !important; + } + + &:hover { + color: $turquoise; + + &.remove-uri { + color: $red; + } + } + } + .list { @include clearfix(); @@ -111,7 +135,7 @@ @include animate(); box-sizing: border-box; display: block; - padding: 14px 12px; + padding: 14px 12px 12px; position: relative; border: 0; border-radius: 3px; @@ -127,6 +151,17 @@ &:hover { background: rgba(255,255,255,0.1); } + + &.draggable { + padding-left: 35px; + + .drag-handle { + position: absolute; + top: 0; + left: 0; + padding: 16px 12px; + } + } } &.playlists { @@ -188,30 +223,6 @@ } } } - - .add-uri, - .remove-uri { - position: absolute; - top: 5px; - right: 0; - padding: 8px; - margin: 0; - min-width: 0; - color: #FFFFFF; - background: transparent; - - &:before { - display: none !important; - } - - &:hover { - color: $turquoise; - - &.remove-uri { - color: $red; - } - } - } } &.kiosk_mode { @@ -289,6 +300,23 @@ } } + &.search_uri_schemes { + .available-schemes { + padding-top: 40px; + + .scheme { + @include animate(); + margin-left: 0; + margin-bottom: 8px; + + &:hover { + cursor: pointer; + background: darken($blue, 8%); + } + } + } + } + .actions { padding-top: 50px; text-align: center; diff --git a/src/scss/global/_core.scss b/src/scss/global/_core.scss index 33682d17..685fb09f 100755 --- a/src/scss/global/_core.scss +++ b/src/scss/global/_core.scss @@ -394,6 +394,11 @@ footer { color: $mid_grey; } + &.large { + padding: 8px 10px 7px; + font-size: 12px; + } + h1 &, h2 & { line-height: 1.4em;