feat: random colour/gradient background, fix toasts

This commit is contained in:
David Ralph
2021-09-17 19:40:22 +01:00
parent e3edc3d89e
commit 94e9c5d65e
14 changed files with 58 additions and 16 deletions

View File

@@ -5,7 +5,7 @@ import PhotoInformation from './PhotoInformation';
import EventBus from 'modules/helpers/eventbus';
import Interval from 'modules/helpers/interval';
import { videoCheck, offlineBackground, gradientStyleBuilder } from 'modules/helpers/background/widget';
import { videoCheck, offlineBackground, gradientStyleBuilder, randomColourStyleBuilder } from 'modules/helpers/background/widget';
import './scss/index.scss';
@@ -92,7 +92,8 @@ export default class Background extends PureComponent {
});
}
switch (localStorage.getItem('backgroundType')) {
const type = localStorage.getItem('backgroundType');
switch (type) {
case 'api':
if (offline) {
return this.setState(offlineBackground());
@@ -185,6 +186,11 @@ export default class Background extends PureComponent {
}
break;
case 'random_colour':
case 'random_gradient':
this.setState(randomColourStyleBuilder(type));
break;
case 'custom':
let customBackground;
try {