mirror of
https://github.com/mue/mue.git
synced 2026-07-12 10:46:12 +02:00
fix: various fixes for offline mode and background components
This commit is contained in:
@@ -67,7 +67,7 @@ export default class About extends React.PureComponent {
|
||||
if (navigator.onLine === false || localStorage.getItem('offlineMode') === 'true') {
|
||||
this.setState({
|
||||
update: this.language.version.offline_mode,
|
||||
loading: window.language.modals.update.offline.title
|
||||
loading: window.language.modals.main.marketplace.offline.description
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,14 @@ export default class BackgroundSettings extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
if (navigator.onLine === false || localStorage.getItem('offlineMode') === 'true') {
|
||||
return this.setState({
|
||||
quoteLanguages: [{
|
||||
name: window.language.modals.main.marketplace.offline.description,
|
||||
value: 'loading'
|
||||
}]
|
||||
});
|
||||
}
|
||||
this.getQuoteLanguages();
|
||||
}
|
||||
|
||||
|
||||
@@ -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' />
|
||||
|
||||
@@ -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/>
|
||||
);
|
||||
|
||||
@@ -57,7 +57,7 @@ export default function PhotoInformation(props) {
|
||||
<span>{props.info.resolution || 'N/A'}</span>
|
||||
<Photographer/>
|
||||
<span>{photographer}</span>
|
||||
{(localStorage.getItem('downloadbtn') === 'true') ?
|
||||
{(localStorage.getItem('downloadbtn') === 'true') && !props.info.offline && !props.info.photographerURL ?
|
||||
<>
|
||||
<Download/>
|
||||
<span className='download' onClick={() => downloadImage(props.info)}>{language.download}</span>
|
||||
|
||||
Reference in New Issue
Block a user