feat: finish 5.0 (mostly)

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2021-04-15 17:15:57 +01:00
parent f874f2a54c
commit 6662514e5f
21 changed files with 2137 additions and 271 deletions

View File

@@ -72,11 +72,17 @@ export default class About extends React.PureComponent {
<p>{this.language.copyright} 2018-{new Date().getFullYear()} Mue Tab (BSD-3 License)</p>
<p>{this.language.version.title} {window.constants.VERSION} ({this.state.update})</p>
<h3>{window.language.modals.welcome.support}</h3>
<h3>{this.language.contact_us}</h3>
<a href='mailto:hello@muetab.com' className='welcomeLink' target='_blank' rel='noopener noreferrer'><EmailIcon/></a>
<a href='https://twitter.com/getmue' className='welcomeLink' target='_blank' rel='noopener noreferrer'><TwitterIcon/></a>
<a href='https://discord.gg/zv8C9F8' className='welcomeLink' target='_blank' rel='noopener noreferrer'><ForumIcon/></a>
<h3>{this.language.support_mue}</h3>
<p><a href='https://github.com/sponsors/davidjcralph' className='welcomeLink' target='_blank' rel='noopener noreferrer'>GitHub Sponsors</a>
<a href='https://ko-fi.com/davidjcralph' className='welcomeLink' target='_blank' rel='noopener noreferrer'>Ko-Fi</a>
<a href='https://patreon.com/davidjcralph' className='welcomeLink' target='_blank' rel='noopener noreferrer'>Patreon</a>
</p>
<h3>{this.language.resources_used.title}</h3>
<p>Pexels ({this.language.resources_used.bg_images})</p>
<p>Google ({this.language.resources_used.pin_icon})</p>

View File

@@ -34,10 +34,10 @@ export default class TimeSettings extends React.PureComponent {
const digitalSettings = (
<>
<h3>{time.digital.title}</h3>
<Radio title={time.format} name='timeformat' options={digitalOptions} smallTitle={true} category='clock' />
<Radio title={time.format} name='timeformat' options={digitalOptions} smallTitle={true} category='clock' element='.other' />
<br/>
<Checkbox name='seconds' text={time.digital.seconds} category='clock' />
<Checkbox name='zero' text={time.digital.zero} category='clock' />
<Checkbox name='seconds' text={time.digital.seconds} category='clock' element='.other' />
<Checkbox name='zero' text={time.digital.zero} category='clock' element='.other' />
</>
);
@@ -62,21 +62,21 @@ export default class TimeSettings extends React.PureComponent {
const longSettings = (
<>
<Checkbox name='dayofweek' text={time.date.day_of_week} category='date' />
<Checkbox name='datenth' text={time.date.datenth} category='date' />
<Checkbox name='dayofweek' text={time.date.day_of_week} category='date' element='.date' />
<Checkbox name='datenth' text={time.date.datenth} category='date' element='.date' />
</>
);
const shortSettings = (
<>
<br/>
<Dropdown label={time.date.short_format} name='dateFormat' category='date'>
<Dropdown label={time.date.short_format} name='dateFormat' category='date' element='.date'>
<option value='DMY'>DMY</option>
<option value='MDY'>MDY</option>
<option value='YMD'>YMD</option>
</Dropdown>
<br/><br/>
<Dropdown label={time.date.short_separator.title} name='shortFormat' category='date'>
<Dropdown label={time.date.short_separator.title} name='shortFormat' category='date' element='.date'>
<option value='dots'>{time.date.short_separator.dots}</option>
<option value='dash'>{time.date.short_separator.dash}</option>
<option value='gaps'>{time.date.short_separator.gaps}</option>
@@ -95,7 +95,7 @@ export default class TimeSettings extends React.PureComponent {
<>
<h2>{time.title}</h2>
<Switch name='time' text={this.language.enabled} category='clock' element='.clock' />
<Dropdown label={time.type} name='timeType' onChange={(value) => this.setState({ timeType: value })} category='clock'>
<Dropdown label={time.type} name='timeType' onChange={(value) => this.setState({ timeType: value })} category='clock' element='.other'>
<option value='digital'>{time.digital.title}</option>
<option value='analogue'>{time.analogue.title}</option>
<option value='percentageComplete'>{time.percentage_complete}</option>
@@ -103,13 +103,13 @@ export default class TimeSettings extends React.PureComponent {
{timeSettings}
<h3>{time.date.title}</h3>
<Switch name='date' text={this.language.enabled} category='date' />
<Dropdown label={time.type} name='dateType' onChange={(value) => this.setState({ dateType: value })} category='date'>
<Switch name='date' text={this.language.enabled} category='date' element='.date'/>
<Dropdown label={time.type} name='dateType' onChange={(value) => this.setState({ dateType: value })} category='date' element='.date'>
<option value='long'>{time.date.type.long}</option>
<option value='short'>{time.date.type.short}</option>
</Dropdown>
<br/>
<Checkbox name='weeknumber' text={time.date.week_number} category='date'/>
<Checkbox name='weeknumber' text={time.date.week_number} category='date' element='.date'/>
{dateSettings}
</>
);

View File

@@ -17,6 +17,15 @@ export default class TimeSettings extends React.PureComponent {
localStorage.setItem('location', this.state.location);
}
changeLocation(e) {
this.setState({
location: e.target.value
});
document.querySelector('.reminder-info').style.display = 'block';
localStorage.setItem('showReminder', true);
}
render() {
const language = window.language.modals.main.settings.sections.weather;
@@ -41,11 +50,12 @@ export default class TimeSettings extends React.PureComponent {
<Switch name='weatherEnabled' text={this.language.enabled} category='widgets'/>
<ul>
<p>{language.location}</p>
<input type='text' value={this.state.location} onChange={(e) => this.setState({ location: e.target.value })}></input>
<input type='text' value={this.state.location} onChange={(e) => this.changeLocation(e)}></input>
</ul>
<br/>
<Radio name='tempformat' title={language.temp_format.title} options={tempFormat} category='weather'/>
<h3>{language.extra_info.title}</h3>
<Checkbox name='showlocation' text={language.extra_info.show_location} category='weather'/>
<Checkbox name='humidity' text={language.extra_info.humidity} category='weather'/>
<Checkbox name='windspeed' text={language.extra_info.wind_speed} category='weather'/>
<Checkbox name='mintemp' text={language.extra_info.min_temp} category='weather'/>