fix: various fixes for offline mode and background components

This commit is contained in:
David Ralph
2021-04-28 14:25:24 +01:00
parent 2afc9159cf
commit b26265eceb
13 changed files with 33 additions and 25 deletions

View File

@@ -158,9 +158,9 @@ export default class BackgroundSettings extends React.PureComponent {
{backgroundSettings}
<h3>{background.buttons.title}</h3>
<Checkbox name='view' text={background.buttons.view} />
<Checkbox name='favouriteEnabled' text={background.buttons.favourite} />
<Checkbox name='downloadbtn' text={background.buttons.download}/>
<Checkbox name='view' text={background.buttons.view} element='.other' />
<Checkbox name='favouriteEnabled' text={background.buttons.favourite} element='.other' />
<Checkbox name='downloadbtn' text={background.buttons.download} element='.other' />
<h3>{background.effects.title}</h3>
<Slider title={background.effects.blur} name='blur' min='0' max='100' default='0' display='%' category='background' />

View File

@@ -30,7 +30,7 @@ export default class ColourSettings extends React.PureComponent {
toast(window.language.toasts.reset);
}
initialiseColorPickerState(gradientSettings) {
initialiseColourPickerState(gradientSettings) {
this.GradientPickerInitalState = {
points: gradientSettings.gradient.map((g) => {
const rgb = hexToRgb(g.colour);
@@ -110,7 +110,7 @@ export default class ColourSettings extends React.PureComponent {
return this.language.sections.background.source.disabled;
}
onColorPickerChange = (attrs, name) => {
onColourPickerChange = (attrs, name) => {
if (process.env.NODE_ENV === 'development') {
console.log(attrs, name);
}
@@ -138,14 +138,14 @@ export default class ColourSettings extends React.PureComponent {
let gradientInputs;
if (gradientHasMoreThanOneColour) {
if (this.GradientPickerInitalState === undefined) {
this.initialiseColorPickerState(this.state.gradientSettings);
this.initialiseColourPickerState(this.state.gradientSettings);
}
gradientInputs = (
<ColorPicker
onStartChange={(color) => this.onColorPickerChange(color, 'start')}
onChange={(color) => this.onColorPickerChange(color, 'change')}
onEndChange={(color) => this.onColorPickerChange(color, 'end')}
onStartChange={(colour) => this.onColourPickerChange(colour, 'start')}
onChange={(colour) => this.onColourPickerChange(colour, 'change')}
onEndChange={(colour) => this.onColourPickerChange(colour, 'end')}
gradient={this.GradientPickerInitalState}
isGradient/>
);