mirror of
https://github.com/mue/mue.git
synced 2026-07-13 20:13:47 +02:00
Totally functional! Just need to refactor like crazy.
This commit is contained in:
@@ -6,8 +6,8 @@ export default class Section extends React.PureComponent {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
this.state = {
|
||||
display: 'block',
|
||||
transform: 'rotate(-180deg)'
|
||||
display: 'none',
|
||||
transform: 'rotate(0)'
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ export default class Section extends React.PureComponent {
|
||||
display: display,
|
||||
transform: transform
|
||||
});
|
||||
|
||||
if(this.props.onToggle) {
|
||||
this.props.onToggle(display);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -14,7 +14,8 @@ export default class BackgroundSettings extends React.PureComponent {
|
||||
this.state = {
|
||||
blur: 0,
|
||||
brightness: 100,
|
||||
gradientSettings: this.DefaultGradientSettings
|
||||
gradientSettings: this.DefaultGradientSettings,
|
||||
shown: false
|
||||
};
|
||||
}
|
||||
|
||||
@@ -262,6 +263,14 @@ export default class BackgroundSettings extends React.PureComponent {
|
||||
});
|
||||
};
|
||||
|
||||
onSection = () => {
|
||||
this.setState((state) => {
|
||||
return {
|
||||
shown: !state.shown
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
let colourSettings = null;
|
||||
if (typeof this.state.gradientSettings === 'object') {
|
||||
@@ -294,7 +303,7 @@ export default class BackgroundSettings extends React.PureComponent {
|
||||
}
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Section title={this.props.language.background.title} name='background'>
|
||||
<Section title={this.props.language.background.title} name='background' onToggle={this.onSection}>
|
||||
<ul>
|
||||
<Checkbox name='view' text={this.props.language.background.view} />
|
||||
<Checkbox name='favouriteEnabled' text={this.props.language.background.favourite} />
|
||||
@@ -329,7 +338,7 @@ export default class BackgroundSettings extends React.PureComponent {
|
||||
<ul>
|
||||
<p>{this.props.language.background.customcolour} <span className='modalLink' onClick={() => this.resetItem('customBackgroundColour')}>{this.props.language.reset}</span></p>
|
||||
<input id='customBackgroundHex' type='hidden' value={this.currentGradientSettings()} />
|
||||
{colourSettings}
|
||||
{this.state.shown && colourSettings}
|
||||
</ul>
|
||||
</Section>
|
||||
</React.Fragment>
|
||||
|
||||
Reference in New Issue
Block a user