From 98b21efbdf8203b5f505563781717b91c49cf618 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Fri, 3 Nov 2017 16:11:14 +1300 Subject: [PATCH] Settings provider tiles --- src/js/views/Settings.js | 41 +++++++++++++++--------- src/scss/views/_settings.scss | 59 +++++++++++++++++++++-------------- 2 files changed, 62 insertions(+), 38 deletions(-) diff --git a/src/js/views/Settings.js b/src/js/views/Settings.js index 378b5567..cf18c62c 100755 --- a/src/js/views/Settings.js +++ b/src/js/views/Settings.js @@ -166,11 +166,18 @@ class Settings extends React.Component { renderServiceStatus(service){ - let colour = 'red' - let icon = 'close' - let name = service.charAt(0).toUpperCase() + service.slice(1).toLowerCase() - let text = 'Disconnected' - let tooltip = null + let colour = 'red'; + let icon = 'close'; + let name = service.charAt(0).toUpperCase() + service.slice(1).toLowerCase(); + let text = 'Disconnected'; + let tooltip = null; + let logo = service; + + if (logo == 'mopidy'){ + logo = 'database'; + } else if (logo == 'pusher'){ + logo = 'rss'; + } service = this.props[service] @@ -195,17 +202,20 @@ class Settings extends React.Component { } return ( -
-

- {name} -

-
- +
+
+
+ +

+ {name} +

+
+ + {text} +
+ {tooltip ? {tooltip} : null} +
-
- {text} -
- {tooltip ? {tooltip} : null}
) } @@ -242,6 +252,7 @@ class Settings extends React.Component { {this.renderServiceStatus('mopidy')} {this.renderServiceStatus('pusher')} {this.renderServiceStatus('spotify')} + {this.renderServiceStatus('lastfm')}

System

diff --git a/src/scss/views/_settings.scss b/src/scss/views/_settings.scss index 9e9bb44c..fceb143c 100755 --- a/src/scss/views/_settings.scss +++ b/src/scss/views/_settings.scss @@ -35,33 +35,46 @@ @include clearfix(); margin-bottom: -20px; - .service { - margin-right: 20px; - margin-bottom: 20px; - padding-left: 46px; - box-sizing: border-box; - position: relative; + .service-wrapper { float: left; - min-width: 150px; + width: 16.6667%; - .title { - margin: 0; - padding: 0; - } + .service { + padding-bottom: 100%; + position: relative; - .icon { - position: absolute; - top: 2px; - left: 0; - width: 34px; - height: 25px; - padding-top: 9px; - border: 2px solid $grey; - text-align: center; - border-radius: 50%; + .liner { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin: 5px; + box-sizing: border-box; + border-radius: 3px; + border: 3px solid rgba(255,255,255,0.1); + text-align: center; - .fa { - font-size: 16px; + .logo { + font-size: 80px; + position: absolute; + top: 20%; + left: 0; + right: 0; + opacity: 0.05; + } + + .title { + padding-top: 55%; + margin-bottom: 0px; + } + + .status { + .fa { + font-size: 12px; + margin-right: 4px; + } + } } } }