refactor: improve dark theme, add switch component etc, fix stuff

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2021-03-20 19:45:49 +00:00
parent b7656fa951
commit e4395497ed
23 changed files with 150 additions and 84 deletions

View File

@@ -24,7 +24,7 @@ export default class About extends React.PureComponent {
const newVersion = versionData[0].tag_name;
let updateMsg = this.language.version.no_update;
if (window.constants.VERSION < newVersion) {
if (Number(window.constants.VERSION) < newVersion) {
updateMsg = `${this.language.version.update_available}: ${newVersion}`;
}

View File

@@ -223,10 +223,8 @@ export default class BackgroundSettings extends React.PureComponent {
<h2>{background.title}</h2>
<Checkbox name='background' text='Enabled' />
<h3>{background.buttons.title}</h3>
<ul>
<Checkbox name='view' text={background.buttons.view} />
<Checkbox name='favouriteEnabled' text={background.buttons.favourite} />
</ul>
<Checkbox name='view' text={background.buttons.view} />
<Checkbox name='favouriteEnabled' text={background.buttons.favourite} />
<h3>{background.effects.title}</h3>
<ul>
@@ -239,12 +237,10 @@ export default class BackgroundSettings extends React.PureComponent {
</ul>
<h3>{background.source.title}</h3>
<ul>
<Dropdown label={background.source.api} name='backgroundAPI'>
<option className='choices' value='mue'>Mue</option>
<option className='choices' value='unsplash'>Unsplash</option>
</Dropdown>
</ul>
<Dropdown label={background.source.api} name='backgroundAPI'>
<option className='choices' value='mue'>Mue</option>
<option className='choices' value='unsplash'>Unsplash</option>
</Dropdown>
<ul>
<p>{background.source.custom_url} <span className='modalLink' onClick={() => this.resetItem('customBackground')}>{this.language.buttons.reset}</span></p>
<input type='text' value={this.state.customBackground} onChange={(e) => this.setState({ customBackground: e.target.value })}></input>

View File

@@ -1,6 +1,7 @@
import React from 'react';
import Checkbox from '../Checkbox';
import Switch from '../Switch';
import DatePicker from 'react-date-picker';
import { toast } from 'react-toastify';
@@ -46,7 +47,7 @@ export default class GreetingSettings extends React.PureComponent {
return (
<div>
<h2>{greeting.title}</h2>
<Checkbox name='greeting' text={this.language.enabled} />
<Switch name='greeting' text={this.language.enabled} />
<Checkbox name='events' text={greeting.events} />
<Checkbox name='defaultGreetingMessage' text={greeting.default} />
<ul>

View File

@@ -67,7 +67,6 @@ export default class TimeSettings extends React.PureComponent {
<h3>{time.date.title}</h3>
<Checkbox name='date' text={this.language.enabled} />
<Checkbox name='dayofweek' text={time.date.day_of_week} />
<Checkbox name='weeknumber' text={time.date.week_number} />
<Checkbox name='datenth' text={time.date.datenth} />
<Checkbox name='short' text={time.date.short_date} betaFeature={true} />
<Dropdown label={time.date.short_format} name='dateFormat'>