Upgrading material icons; Snapcast styles

This commit is contained in:
James Barnsley
2019-11-06 21:40:14 +13:00
parent bdda83eedf
commit 17763f7fe7
9 changed files with 5523 additions and 10003 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -100,7 +100,7 @@
// Release details
// These are automatically injected to built HTML
var build = "1573000109";
var build = "1573028240";
var version = "3.42.2";
// Construct the script tag

33
src/js/components/SnapcastGroups.js Normal file → Executable file
View File

@ -115,25 +115,26 @@ const SnapcastGroups = (props) => {
const renderMenuItem = (group) => {
const icon = () => {
const iconWords = {
business: ['office', 'work'],
king_bed: ['bed'],
tv: ['lounge', 'tv'],
local_laundry_service: ['garage', 'laundry'],
fitness_center: ['gym'],
emoji_food_beverage: ['kitchen'],
deck: ['deck', 'outside'],
restaurant_menu: ['dining'],
};
const iconWords = [
{ icon: 'business', words: ['office', 'work'] },
{ icon: 'king_bed', words: ['bed'] },
{ icon: 'tv', words: ['lounge', 'tv'] },
{ icon: 'directions_car', words: ['garage', 'laundry'] },
{ icon: 'fitness_center', words: ['gym'] },
{ icon: 'emoji_food_beverage', words: ['kitchen'] },
{ icon: 'deck', words: ['deck', 'outside'] },
{ icon: 'restaurant_menu', words: ['dining'] },
{ icon: 'laptop', words: ['laptop'] },
];
const name = group.name.toLowerCase();
for (let key in iconWords){
if (iconWords.hasOwnProperty(key)) {
if (iconWords[key].map(word => name.match(`/${word}/g`))) {
return key;
for (let item of iconWords) {
for (let word of item.words) {
if (name.match(new RegExp(`(${word})`, 'gi'))) {
return item.icon;
}
}
}
return 'speaker';
};
return 'speaker_group';
}
return (
<Link

View File

@ -32,11 +32,12 @@
&__groups {
padding-top: 20px;
margin-bottom: -10px;
.menu {
.menu-item {
width: 15%;
min-width: 100px;
width: 12.5%;
min-width: 80px;
max-width: 140px;
&__inner {