mirror of
https://github.com/mue/mue.git
synced 2026-07-13 20:13:47 +02:00
feat: random colour/gradient background, fix toasts
This commit is contained in:
@@ -111,7 +111,7 @@ export default class Marketplace extends PureComponent {
|
||||
uninstall(this.state.item.type, this.state.item.display_name);
|
||||
}
|
||||
|
||||
toast(this.getMessage('toats.' + type + 'ed'));
|
||||
toast(this.getMessage('toasts.' + type + 'ed'));
|
||||
this.setState({
|
||||
button: (type === 'install') ? this.buttons.uninstall : this.buttons.install
|
||||
});
|
||||
|
||||
@@ -230,6 +230,8 @@ export default class BackgroundSettings extends PureComponent {
|
||||
<option value='api'>{getMessage('modals.main.settings.sections.background.type.api')}</option>
|
||||
<option value='custom'>{getMessage('modals.main.settings.sections.background.type.custom_image')}</option>
|
||||
<option value='colour'>{getMessage('modals.main.settings.sections.background.type.custom_colour')}</option>
|
||||
<option value='random_colour'>{getMessage('modals.main.settings.sections.background.type.random_colour')}</option>
|
||||
<option value='random_gradient'>{getMessage('modals.main.settings.sections.background.type.random_gradient')}</option>
|
||||
</Dropdown>
|
||||
<br/>
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user