mirror of
https://github.com/mue/mue.git
synced 2026-07-14 04:24:01 +02:00
feat: finish quick links, start weather widget, bug fixes etc
Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
18
src/components/modals/main/settings/sections/QuickLinks.jsx
Normal file
18
src/components/modals/main/settings/sections/QuickLinks.jsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
|
||||
import Switch from '../Switch';
|
||||
import Checkbox from '../Checkbox';
|
||||
|
||||
export default function QuickLinks() {
|
||||
const language = window.language.modals.main.settings.sections.quicklinks;
|
||||
|
||||
return (
|
||||
<>
|
||||
<h2>{language.title}</h2>
|
||||
<Switch name='quicklinksenabled' text={window.language.modals.main.settings.enabled} />
|
||||
<Checkbox name='quicklinksnewtab' text='Open in new tab' />
|
||||
<Checkbox name='quicklinkstooltip' text='Tooltip' />
|
||||
<Checkbox name='quicklinksnewtab' text='Chrome Apps' />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -88,6 +88,7 @@ export default class TimeSettings extends React.PureComponent {
|
||||
switch (this.state.dateType) {
|
||||
case 'short': dateSettings = shortSettings; break;
|
||||
case 'long': dateSettings = longSettings; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
55
src/components/modals/main/settings/sections/Weather.jsx
Normal file
55
src/components/modals/main/settings/sections/Weather.jsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import React from 'react';
|
||||
|
||||
import Switch from '../Switch';
|
||||
import Radio from '../Radio';
|
||||
|
||||
export default class TimeSettings extends React.PureComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
location: localStorage.getItem('location') || 'London'
|
||||
};
|
||||
this.language = window.language.modals.main.settings;
|
||||
}
|
||||
|
||||
getLocation() {
|
||||
if (window.navigator.geolocation) {
|
||||
window.navigator.geolocation.getCurrentPosition(console.log, console.log);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
localStorage.setItem('location', this.state.location);
|
||||
}
|
||||
|
||||
render() {
|
||||
const language = window.language.modals.main.settings.sections.weather;
|
||||
|
||||
const tempFormat = [
|
||||
{
|
||||
'name': 'Celsius',
|
||||
'value': 'celsius'
|
||||
},
|
||||
{
|
||||
'name': 'Fahrenheit',
|
||||
'value': 'fahrenheit'
|
||||
},
|
||||
{
|
||||
'name': 'Kelvin',
|
||||
'value': 'kelvin'
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<h2>{language.title}</h2>
|
||||
<Switch name='weatherEnabled' text={this.language.enabled} />
|
||||
<Radio name='tempformat' title='Temperature Format' options={tempFormat} />
|
||||
<ul>
|
||||
<p>Location <span className='modalLink' onClick={() => this.getLocation()}>Auto</span></p>
|
||||
<input type='text' value={this.state.location} onChange={(e) => this.setState({ location: e.target.value })}></input>
|
||||
</ul>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user