import React from 'react'; import Switch from '../Switch'; import Radio from '../Radio'; import Checkbox from '../Checkbox'; 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': language.temp_format.celsius + ' (°C)', 'value': 'celsius' }, { 'name': language.temp_format.fahrenheit + ' (°F)', 'value': 'fahrenheit' }, { 'name': language.temp_format.kelvin + ' (K)', 'value': 'kelvin' } ]; return ( <>
{language.location} this.getLocation()}>{language.auto}
this.setState({ location: e.target.value })}>