Upgrading material icons; Snapcast styles
This commit is contained in:
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
Binary file not shown.
@ -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
|
||||
|
||||
Binary file not shown.
33
src/js/components/SnapcastGroups.js
Normal file → Executable file
33
src/js/components/SnapcastGroups.js
Normal file → Executable 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
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user