chore: run prettier

This commit is contained in:
David Ralph 2022-11-06 11:59:59 +00:00
parent f0968195cb
commit 333aabde1b
60 changed files with 259 additions and 223 deletions

View File

@ -53,10 +53,7 @@ function EmblaCarousel({ data }) {
{data.map((photo, index) => ( {data.map((photo, index) => (
<div className="carousel_slide" key={index}> <div className="carousel_slide" key={index}>
<div className="carousel_slide_inner"> <div className="carousel_slide_inner">
<img <img src={photo.url.default} alt="Marketplace example screenshot" />
src={photo.url.default}
alt="Marketplace example screenshot"
/>
</div> </div>
</div> </div>
))} ))}

View File

@ -48,7 +48,6 @@
height: 190px; height: 190px;
} }
.carousel_button { .carousel_button {
outline: 0; outline: 0;
cursor: pointer; cursor: pointer;

View File

@ -142,11 +142,13 @@ export default class Item extends PureComponent {
<span className="link" onClick={() => this.incrementCount()}> <span className="link" onClick={() => this.incrementCount()}>
{this.state.count !== this.props.data.data.quotes.length ? ( {this.state.count !== this.props.data.data.quotes.length ? (
<> <>
<MdExpandMore /> {variables.getMessage('modals.main.marketplace.product.show_all')} <MdExpandMore />{' '}
{variables.getMessage('modals.main.marketplace.product.show_all')}
</> </>
) : ( ) : (
<> <>
<MdExpandLess /> {variables.getMessage('modals.main.marketplace.product.show_less')} <MdExpandLess />{' '}
{variables.getMessage('modals.main.marketplace.product.show_less')}
</> </>
)} )}
</span> </span>
@ -253,7 +255,10 @@ export default class Item extends PureComponent {
<MdIosShare /> <MdIosShare />
</button> </button>
</Tooltip> </Tooltip>
<Tooltip title={variables.getMessage('modals.main.marketplace.product.buttons.report')} key="report"> <Tooltip
title={variables.getMessage('modals.main.marketplace.product.buttons.report')}
key="report"
>
<button <button
onClick={() => onClick={() =>
window.open( window.open(

View File

@ -1,10 +1,6 @@
import variables from 'modules/variables'; import variables from 'modules/variables';
import React, { memo } from 'react'; import React, { memo } from 'react';
import { import { MdAutoFixHigh, MdOutlineArrowForward, MdOutlineOpenInNew } from 'react-icons/md';
MdAutoFixHigh,
MdOutlineArrowForward,
MdOutlineOpenInNew,
} from 'react-icons/md';
function Items({ function Items({
type, type,
@ -17,7 +13,8 @@ function Items({
}) { }) {
return ( return (
<> <>
{(type === 'all' && !onCollection && (filter === null || filter === '')) || (type === 'collections' && !onCollection && (filter === null || filter === '')) ? ( {(type === 'all' && !onCollection && (filter === null || filter === '')) ||
(type === 'collections' && !onCollection && (filter === null || filter === '')) ? (
<> <>
<div <div
className="collection" className="collection"
@ -55,7 +52,8 @@ function Items({
</> </>
) : null} ) : null}
<div className="items"> <div className="items">
{items?.filter( {items
?.filter(
(item) => (item) =>
item.name.toLowerCase().includes(filter.toLowerCase()) || item.name.toLowerCase().includes(filter.toLowerCase()) ||
filter === '' || filter === '' ||

View File

@ -7,9 +7,7 @@ function SideloadFailedModal({ modalClose, reason }) {
return ( return (
<div className="smallModal"> <div className="smallModal">
<div className="shareHeader"> <div className="shareHeader">
<span className="title"> <span className="title">{variables.getMessage('modals.main.error_boundary.title')}</span>
{variables.getMessage('modals.main.error_boundary.title')}
</span>
<Tooltip <Tooltip
title={variables.getMessage('modals.main.settings.sections.advanced.reset_modal.cancel')} title={variables.getMessage('modals.main.settings.sections.advanced.reset_modal.cancel')}
> >
@ -19,9 +17,7 @@ function SideloadFailedModal({ modalClose, reason }) {
</Tooltip> </Tooltip>
</div> </div>
<span>{variables.getMessage('modals.main.addons.sideload.failed')}</span> <span>{variables.getMessage('modals.main.addons.sideload.failed')}</span>
<span className="subtitle"> <span className="subtitle">{reason}</span>
{reason}
</span>
</div> </div>
); );
} }

View File

@ -389,9 +389,7 @@ export default class Create extends PureComponent {
); );
// photos // photos
const nextPhotosDisabled = !( const nextPhotosDisabled = !(this.state.addonData.photos !== '');
this.state.addonData.photos !== ''
);
const addPhotos = ( const addPhotos = (
<> <>
<SettingsItem <SettingsItem
@ -490,7 +488,10 @@ export default class Create extends PureComponent {
<div className="flexTopMarketplace"> <div className="flexTopMarketplace">
{this.state.currentTab !== 1 && ( {this.state.currentTab !== 1 && (
<div className="returnButton"> <div className="returnButton">
<Tooltip title={variables.getMessage('modals.main.navbar.marketplace.product.buttons.back')} key="backArrow"> <Tooltip
title={variables.getMessage('modals.main.navbar.marketplace.product.buttons.back')}
key="backArrow"
>
<MdArrowBack <MdArrowBack
className="backArrow" className="backArrow"
onClick={() => this.changeTab(this.state.currentTab - 1)} onClick={() => this.changeTab(this.state.currentTab - 1)}

View File

@ -390,7 +390,7 @@ export default class Marketplace extends PureComponent {
</div> </div>
</> </>
)} )}
{(this.props.type === 'collections' && !this.state.collection) ? ( {this.props.type === 'collections' && !this.state.collection ? (
this.state.items.map((item) => ( this.state.items.map((item) => (
<> <>
{!item.news ? ( {!item.news ? (

View File

@ -167,7 +167,6 @@ h5 {
align-items: center; align-items: center;
} }
.languageSettings { .languageSettings {
margin-bottom: 15px; margin-bottom: 15px;
.MuiFormGroup-root { .MuiFormGroup-root {

View File

@ -486,7 +486,6 @@ a.collectionButton {
all: unset; all: unset;
} }
@include themed() { @include themed() {
&:focus-within { &:focus-within {
background: t($modal-sidebarActive); background: t($modal-sidebarActive);
box-shadow: 0 0 0 1px t($color); box-shadow: 0 0 0 1px t($color);
@ -523,4 +522,3 @@ a.collectionButton {
font-size: 30px; font-size: 30px;
} }
} }

View File

@ -29,7 +29,7 @@ export default class Dropdown extends PureComponent {
if (!this.props.noSetting) { if (!this.props.noSetting) {
localStorage.setItem(this.props.name, value); localStorage.setItem(this.props.name, value);
localStorage.setItem(this.props.name2, this.props.value2) localStorage.setItem(this.props.name2, this.props.value2);
} }
if (this.props.onChange) { if (this.props.onChange) {

View File

@ -22,7 +22,10 @@ function AppearanceSettings() {
<span className="title"> <span className="title">
{variables.getMessage('modals.main.settings.sections.appearance.theme.title')} {variables.getMessage('modals.main.settings.sections.appearance.theme.title')}
</span> </span>
<span className="subtitle"> {variables.getMessage('modals.main.settings.sections.appearance.theme.description')}</span> <span className="subtitle">
{' '}
{variables.getMessage('modals.main.settings.sections.appearance.theme.description')}
</span>
</div> </div>
<div className="action"> <div className="action">
<Radio <Radio
@ -50,7 +53,9 @@ function AppearanceSettings() {
<span className="title"> <span className="title">
{variables.getMessage('modals.main.settings.sections.appearance.font.title')} {variables.getMessage('modals.main.settings.sections.appearance.font.title')}
</span> </span>
<span className="subtitle">{variables.getMessage('modals.main.settings.sections.appearance.font.description')}</span> <span className="subtitle">
{variables.getMessage('modals.main.settings.sections.appearance.font.description')}
</span>
</div> </div>
<div className="action"> <div className="action">
<Checkbox <Checkbox
@ -124,7 +129,9 @@ function AppearanceSettings() {
</div> </div>
<SettingsItem <SettingsItem
title={variables.getMessage('modals.main.settings.sections.appearance.style.title')} title={variables.getMessage('modals.main.settings.sections.appearance.style.title')}
subtitle={variables.getMessage('modals.main.settings.sections.appearance.style.description')} subtitle={variables.getMessage(
'modals.main.settings.sections.appearance.style.description',
)}
> >
<Radio <Radio
name="widgetStyle" name="widgetStyle"
@ -145,7 +152,9 @@ function AppearanceSettings() {
<SettingsItem <SettingsItem
title={variables.getMessage('modals.main.settings.sections.appearance.accessibility.title')} title={variables.getMessage('modals.main.settings.sections.appearance.accessibility.title')}
subtitle={variables.getMessage('modals.main.settings.sections.appearance.accessibility.description')} subtitle={variables.getMessage(
'modals.main.settings.sections.appearance.accessibility.description',
)}
final={true} final={true}
> >
<Dropdown <Dropdown
@ -155,9 +164,23 @@ function AppearanceSettings() {
name="textBorder" name="textBorder"
category="other" category="other"
> >
<option value="new">{variables.getMessage('modals.main.settings.sections.appearance.accessibility.text_shadow.new',)}</option> {/* default */} <option value="new">
<option value="true">{variables.getMessage('modals.main.settings.sections.appearance.accessibility.text_shadow.old',)}</option> {/* old checkbox setting */} {variables.getMessage(
<option value="none">{variables.getMessage('modals.main.settings.sections.appearance.accessibility.text_shadow.none')}</option> 'modals.main.settings.sections.appearance.accessibility.text_shadow.new',
)}
</option>{' '}
{/* default */}
<option value="true">
{variables.getMessage(
'modals.main.settings.sections.appearance.accessibility.text_shadow.old',
)}
</option>{' '}
{/* old checkbox setting */}
<option value="none">
{variables.getMessage(
'modals.main.settings.sections.appearance.accessibility.text_shadow.none',
)}
</option>
</Dropdown> </Dropdown>
<Checkbox <Checkbox
text={variables.getMessage( text={variables.getMessage(

View File

@ -109,8 +109,10 @@ export default class Changelog extends PureComponent {
return errorMessage( return errorMessage(
<> <>
<MdOutlineWifiOff /> <MdOutlineWifiOff />
<span className='title'>{variables.getMessage('modals.main.error_boundary.title')}</span> <span className="title">{variables.getMessage('modals.main.error_boundary.title')}</span>
<span className="subtitle">{variables.getMessage('modals.main.error_boundary.message')}</span> <span className="subtitle">
{variables.getMessage('modals.main.error_boundary.message')}
</span>
</>, </>,
); );
} }

View File

@ -95,7 +95,7 @@ export default class Message extends PureComponent {
)} )}
onChange={(e) => this.message(e, true, index)} onChange={(e) => this.message(e, true, index)}
varient="outlined" varient="outlined"
style={{ padding: "0"}} style={{ padding: '0' }}
/> />
</div> </div>
</div> </div>
@ -117,8 +117,12 @@ export default class Message extends PureComponent {
<div className="photosEmpty"> <div className="photosEmpty">
<div className="emptyNewMessage"> <div className="emptyNewMessage">
<MdOutlineTextsms /> <MdOutlineTextsms />
<span className="title">{variables.getMessage('modals.main.settings.sections.message.no_messages')}</span> <span className="title">
<span className="subtitle">{variables.getMessage('modals.main.settings.sections.message.add_some')}</span> {variables.getMessage('modals.main.settings.sections.message.no_messages')}
</span>
<span className="subtitle">
{variables.getMessage('modals.main.settings.sections.message.add_some')}
</span>
<button onClick={() => this.modifyMessage('add')}> <button onClick={() => this.modifyMessage('add')}>
{variables.getMessage('modals.main.settings.sections.message.add')} {variables.getMessage('modals.main.settings.sections.message.add')}
<MdAdd /> <MdAdd />

View File

@ -43,9 +43,9 @@ export default class OrderSettings extends PureComponent {
date: '', date: '',
description: '', description: '',
link: '', link: '',
linkText: '' linkText: '',
}, },
newsDone: false newsDone: false,
}; };
} }
@ -108,7 +108,7 @@ export default class OrderSettings extends PureComponent {
const data = await (await fetch('https://api.muetab.com/news')).json(); const data = await (await fetch('https://api.muetab.com/news')).json();
this.setState({ this.setState({
news: data.news, news: data.news,
newsDone: true newsDone: true,
}); });
} }
@ -151,11 +151,13 @@ export default class OrderSettings extends PureComponent {
})} })}
</div> </div>
</div> </div>
<div style={{ display: "flex", flexFlow: "column" }}> <div style={{ display: 'flex', flexFlow: 'column' }}>
<span className='title'>{this.state.news.title}</span> <span className="title">{this.state.news.title}</span>
<span className='subtitle'>{this.state.news.date}</span> <span className="subtitle">{this.state.news.date}</span>
<span>{this.state.news.description}</span> <span>{this.state.news.description}</span>
<a className='link' href={this.state.news.link}>{this.state.news.linkText}</a> <a className="link" href={this.state.news.link}>
{this.state.news.linkText}
</a>
</div> </div>
</div> </div>
<div> <div>

View File

@ -259,9 +259,7 @@ export default class QuoteSettings extends PureComponent {
value2={Date.now()} value2={Date.now()}
> >
<option value="refresh">{variables.getMessage('tabname')}</option> <option value="refresh">{variables.getMessage('tabname')}</option>
<option value={10000}> <option value={10000}>10 seconds</option>
10 seconds
</option>
<option value={60000}> <option value={60000}>
{variables.getMessage('modals.main.settings.sections.background.interval.minute')} {variables.getMessage('modals.main.settings.sections.background.interval.minute')}
</option> </option>

View File

@ -71,12 +71,27 @@ export default class TimeSettings extends PureComponent {
zoomCategory="weather" zoomCategory="weather"
switch={true} switch={true}
/> />
<SettingsItem title={variables.getMessage('modals.main.settings.sections.weather.widget_type')}> <SettingsItem
<Dropdown label={variables.getMessage('modals.main.settings.sections.time.type')} name="weatherType" category="weather" onChange={() => this.forceUpdate()}> title={variables.getMessage('modals.main.settings.sections.weather.widget_type')}
<option value="1">{variables.getMessage('modals.main.settings.sections.weather.options.basic')}</option> >
<option value="2">{variables.getMessage('modals.main.settings.sections.weather.options.standard')}</option> <Dropdown
<option value="3">{variables.getMessage('modals.main.settings.sections.weather.options.expanded')}</option> label={variables.getMessage('modals.main.settings.sections.time.type')}
<option value="4">{variables.getMessage('modals.main.settings.sections.weather.options.custom')}</option> name="weatherType"
category="weather"
onChange={() => this.forceUpdate()}
>
<option value="1">
{variables.getMessage('modals.main.settings.sections.weather.options.basic')}
</option>
<option value="2">
{variables.getMessage('modals.main.settings.sections.weather.options.standard')}
</option>
<option value="3">
{variables.getMessage('modals.main.settings.sections.weather.options.expanded')}
</option>
<option value="4">
{variables.getMessage('modals.main.settings.sections.weather.options.custom')}
</option>
</Dropdown> </Dropdown>
</SettingsItem> </SettingsItem>
<SettingsItem <SettingsItem
@ -126,9 +141,10 @@ export default class TimeSettings extends PureComponent {
/> />
</SettingsItem> </SettingsItem>
{weatherType === '4' && ( {weatherType === '4' && (
<SettingsItem title={variables.getMessage( <SettingsItem
'modals.main.settings.sections.weather.custom_settings', title={variables.getMessage('modals.main.settings.sections.weather.custom_settings')}
)} final={true}> final={true}
>
<Checkbox <Checkbox
name="weatherdescription" name="weatherdescription"
text={variables.getMessage( text={variables.getMessage(

View File

@ -15,7 +15,7 @@ import { videoCheck } from 'modules/helpers/background/widget';
import Checkbox from '../../Checkbox'; import Checkbox from '../../Checkbox';
import FileUpload from '../../FileUpload'; import FileUpload from '../../FileUpload';
import Tooltip from '../../../../../helpers/tooltip/Tooltip' import Tooltip from '../../../../../helpers/tooltip/Tooltip';
import Modal from 'react-modal'; import Modal from 'react-modal';

View File

@ -1,11 +1,7 @@
import { memo } from 'react'; import { memo } from 'react';
function DateSkeleton() { function DateSkeleton() {
return ( return <span className="date">Thursday January 1st</span>;
<span className="date">
Thursday January 1st
</span>
);
} }
export default memo(DateSkeleton); export default memo(DateSkeleton);

View File

@ -273,15 +273,11 @@ export default class WelcomeSections extends PureComponent {
<div className="options"> <div className="options">
<div className={this.state.legacyStyle} onClick={() => this.changeStyle('legacy')}> <div className={this.state.legacyStyle} onClick={() => this.changeStyle('legacy')}>
<MdArchive /> <MdArchive />
<span> <span>{variables.getMessage('modals.welcome.sections.style.legacy')}</span>
{variables.getMessage('modals.welcome.sections.style.legacy')}
</span>
</div> </div>
<div className={this.state.newStyle} onClick={() => this.changeStyle('new')}> <div className={this.state.newStyle} onClick={() => this.changeStyle('new')}>
<MdOutlineWhatshot /> <MdOutlineWhatshot />
<span> <span>{variables.getMessage('modals.welcome.sections.style.modern')}</span>
{variables.getMessage('modals.welcome.sections.style.modern')}
</span>
</div> </div>
</div> </div>
</div> </div>

View File

@ -217,7 +217,6 @@ a.privacy {
animation-timing-function: ease-in;*/ animation-timing-function: ease-in;*/
} }
.welcomeContent { .welcomeContent {
.light { .light {
.toggle.lightTheme { .toggle.lightTheme {

View File

@ -253,7 +253,8 @@ export default class Background extends PureComponent {
const randomNumber = Math.floor(Math.random() * photoPack.length); const randomNumber = Math.floor(Math.random() * photoPack.length);
const randomPhoto = photoPack[randomNumber]; const randomPhoto = photoPack[randomNumber];
if ( if (
(localStorage.getItem('backgroundchange') === 'refresh' && this.state.firstTime === true) || (localStorage.getItem('backgroundchange') === 'refresh' &&
this.state.firstTime === true) ||
(localStorage.getItem('backgroundchange') === null && this.state.firstTime === true) (localStorage.getItem('backgroundchange') === null && this.state.firstTime === true)
) { ) {
localStorage.setItem('marketplaceNumber', randomNumber); localStorage.setItem('marketplaceNumber', randomNumber);

View File

@ -19,7 +19,7 @@ export default class Navbar extends PureComponent {
classList: localStorage.getItem('widgetStyle') === 'legacy' ? 'navbar old' : 'navbar new', classList: localStorage.getItem('widgetStyle') === 'legacy' ? 'navbar old' : 'navbar new',
refreshText: '', refreshText: '',
refreshEnabled: localStorage.getItem('refresh'), refreshEnabled: localStorage.getItem('refresh'),
refreshOption: localStorage.getItem('refreshOption') || '' refreshOption: localStorage.getItem('refreshOption') || '',
}; };
} }
@ -61,7 +61,7 @@ export default class Navbar extends PureComponent {
if (data === 'navbar' || data === 'background') { if (data === 'navbar' || data === 'background') {
this.setState({ this.setState({
refreshEnabled: localStorage.getItem('refresh'), refreshEnabled: localStorage.getItem('refresh'),
refreshOption: localStorage.getItem('refreshOption') refreshOption: localStorage.getItem('refreshOption'),
}); });
try { try {
this.updateRefreshText(); this.updateRefreshText();

View File

@ -20,8 +20,8 @@ class Notes extends PureComponent {
setZoom() { setZoom() {
this.setState({ this.setState({
zoomFontSize: Number(((localStorage.getItem('zoomNavbar') || 100) / 100) * 1.2) + "rem" zoomFontSize: Number(((localStorage.getItem('zoomNavbar') || 100) / 100) * 1.2) + 'rem',
}) });
} }
componentDidMount() { componentDidMount() {
@ -56,13 +56,13 @@ class Notes extends PureComponent {
hideNotes() { hideNotes() {
this.setState({ this.setState({
showNotes: (localStorage.getItem('notesPinned') === 'true'), showNotes: localStorage.getItem('notesPinned') === 'true',
}); });
} }
pin() { pin() {
variables.stats.postEvent('feature', 'Notes pin'); variables.stats.postEvent('feature', 'Notes pin');
const notesPinned = (localStorage.getItem('notesPinned') === 'true'); const notesPinned = localStorage.getItem('notesPinned') === 'true';
localStorage.setItem('notesPinned', !notesPinned); localStorage.setItem('notesPinned', !notesPinned);
this.setState({ this.setState({
showNotes: !notesPinned, showNotes: !notesPinned,

View File

@ -35,7 +35,7 @@ class Todo extends PureComponent {
setZoom() { setZoom() {
this.setState({ this.setState({
zoomFontSize: Number(((localStorage.getItem('zoomNavbar') || 100) / 100) * 1.2) + "rem" zoomFontSize: Number(((localStorage.getItem('zoomNavbar') || 100) / 100) * 1.2) + 'rem',
}); });
} }
@ -78,7 +78,7 @@ class Todo extends PureComponent {
hideTodo() { hideTodo() {
this.setState({ this.setState({
showTodo: (localStorage.getItem('todoPinned') === 'true'), showTodo: localStorage.getItem('todoPinned') === 'true',
}); });
} }
@ -122,7 +122,7 @@ class Todo extends PureComponent {
pin() { pin() {
variables.stats.postEvent('feature', 'Todo pin'); variables.stats.postEvent('feature', 'Todo pin');
const todoPinned = (localStorage.getItem('todoPinned') === 'true'); const todoPinned = localStorage.getItem('todoPinned') === 'true';
localStorage.setItem('todoPinned', !todoPinned); localStorage.setItem('todoPinned', !todoPinned);
this.setState({ this.setState({
showTodo: !todoPinned, showTodo: !todoPinned,

View File

@ -132,9 +132,14 @@ export default class Quote extends PureComponent {
) )
).json(); ).json();
const metadata = authorimglicensedata.query.pages[Object.keys(authorimglicensedata.query.pages)[0]].imageinfo[0].extmetadata; const metadata =
authorimglicensedata.query.pages[Object.keys(authorimglicensedata.query.pages)[0]]
.imageinfo[0].extmetadata;
const license = metadata.LicenseShortName; const license = metadata.LicenseShortName;
const photographer = metadata.Attribution.value || metadata.Artist?.value.match(/<a.+>(?<name>.+)<\/a>/i)?.groups.name || 'Unknown'; const photographer =
metadata.Attribution.value ||
metadata.Artist?.value.match(/<a.+>(?<name>.+)<\/a>/i)?.groups.name ||
'Unknown';
authorimglicense = `© ${photographer}. ${license.value}`; authorimglicense = `© ${photographer}. ${license.value}`;
authorimglicense = authorimglicense.replace(/copyright\s/i, '').replace(/©\s©\s/, '© '); authorimglicense = authorimglicense.replace(/copyright\s/i, '').replace(/©\s©\s/, '© ');
@ -197,18 +202,17 @@ export default class Quote extends PureComponent {
? customQuote[Math.floor(Math.random() * customQuote.length)] ? customQuote[Math.floor(Math.random() * customQuote.length)]
: null; : null;
if (customQuote !== undefined) { if (customQuote !== undefined) {
return this.setState({ return this.setState({
quote: '"' + customQuote.quote + '"', quote: '"' + customQuote.quote + '"',
author: customQuote.author, author: customQuote.author,
authorlink: this.getAuthorLink(customQuote.author), authorlink: this.getAuthorLink(customQuote.author),
authorimg: await this.getAuthorImg(customQuote.author), authorimg: await this.getAuthorImg(customQuote.author),
noQuote: false noQuote: false,
}); });
} else { } else {
this.setState({ this.setState({
noQuote: true noQuote: true,
}); });
} }
break; break;
@ -335,7 +339,7 @@ export default class Quote extends PureComponent {
} }
componentDidMount() { componentDidMount() {
const test = localStorage.getItem('quotechange') const test = localStorage.getItem('quotechange');
this.interval = setInterval(() => { this.interval = setInterval(() => {
if (test !== null) { if (test !== null) {
@ -387,7 +391,10 @@ export default class Quote extends PureComponent {
} }
}); });
if (localStorage.getItem('quotechange') === 'refresh' || (localStorage.getItem('quotechange')) === null ) { if (
localStorage.getItem('quotechange') === 'refresh' ||
localStorage.getItem('quotechange') === null
) {
this.setZoom(); this.setZoom();
this.getQuote(); this.getQuote();
localStorage.setItem('quoteStartTime', Date.now()); localStorage.setItem('quoteStartTime', Date.now());

View File

@ -110,7 +110,7 @@ export default class Search extends PureComponent {
toggleDropdown() { toggleDropdown() {
this.setState({ this.setState({
searchDropdown: (this.state.searchDropdown === 'hidden') ? 'visible' : 'hidden', searchDropdown: this.state.searchDropdown === 'hidden' ? 'visible' : 'hidden',
}); });
} }
@ -171,7 +171,9 @@ export default class Search extends PureComponent {
{localStorage.getItem('searchDropdown') === 'true' ? ( {localStorage.getItem('searchDropdown') === 'true' ? (
<Tooltip title={variables.getMessage('widgets.search')}> <Tooltip title={variables.getMessage('widgets.search')}>
<button> <button>
<MdScreenSearchDesktop onClick={() => this.setState({ searchDropdown: !this.state.searchDropdown })} /> <MdScreenSearchDesktop
onClick={() => this.setState({ searchDropdown: !this.state.searchDropdown })}
/>
</button> </button>
</Tooltip> </Tooltip>
) : ( ) : (
@ -199,7 +201,8 @@ export default class Search extends PureComponent {
</form> </form>
</div> </div>
<div> <div>
{localStorage.getItem('searchDropdown') === 'true' && this.state.searchDropdown === true ? ( {localStorage.getItem('searchDropdown') === 'true' &&
this.state.searchDropdown === true ? (
<div className="searchDropdown"> <div className="searchDropdown">
{searchEngines.map(({ name }) => { {searchEngines.map(({ name }) => {
if (name === this.state.currentSearch) { if (name === this.state.currentSearch) {

View File

@ -164,7 +164,7 @@ export default class Clock extends PureComponent {
<Analog <Analog
className="analogclock clock-container" className="analogclock clock-container"
value={this.state.time} value={this.state.time}
size={1.5 * Number((localStorage.getItem('zoomClock') || 100))} size={1.5 * Number(localStorage.getItem('zoomClock') || 100)}
renderMinuteMarks={enabled('minuteMarks')} renderMinuteMarks={enabled('minuteMarks')}
renderHourMarks={enabled('hourMarks')} renderHourMarks={enabled('hourMarks')}
renderSecondHand={enabled('secondHand')} renderSecondHand={enabled('secondHand')}

View File

@ -45,10 +45,7 @@ function Expanded({ state, weatherType, variables }) {
{state.weather.wind_speed} {state.weather.wind_speed}
<span className="minmax"> m/s</span>{' '} <span className="minmax"> m/s</span>{' '}
{enabled('windDirection') ? ( {enabled('windDirection') ? (
<WindDirectionIcon <WindDirectionIcon className="weatherIcon" degrees={state.weather.wind_degrees} />
className="weatherIcon"
degrees={state.weather.wind_degrees}
/>
) : null} ) : null}
</span> </span>
</Tooltip> </Tooltip>

View File

@ -72,9 +72,9 @@ export default class Weather extends PureComponent {
wind_degrees: data.wind.deg, wind_degrees: data.wind.deg,
cloudiness: data.clouds.all, cloudiness: data.clouds.all,
visibility: data.visibility, visibility: data.visibility,
pressure: data.main.pressure pressure: data.main.pressure,
}, },
done: true done: true,
}); });
document.querySelector('.tweather svg').style.fontSize = zoomWeather; document.querySelector('.tweather svg').style.fontSize = zoomWeather;
@ -135,7 +135,9 @@ export default class Weather extends PureComponent {
<span className="loc">{this.state.location}</span> <span className="loc">{this.state.location}</span>
</div> </div>
)} )}
{weatherType >= 3 ? <Expanded weatherType={weatherType} state={this.state} variables={variables}/> : null} {weatherType >= 3 ? (
<Expanded weatherType={weatherType} state={this.state} variables={variables} />
) : null}
</div> </div>
); );
} }

View File

@ -1,4 +1,3 @@
import { memo } from 'react'; import { memo } from 'react';
import { import {

View File

@ -40,7 +40,8 @@ variables.language = new I18n(variables.languagecode, {
tr_TR: translations.tr_TR, tr_TR: translations.tr_TR,
}); });
variables.getMessage = (text, optional) => variables.language.getMessage(variables.languagecode, text, optional || {}); variables.getMessage = (text, optional) =>
variables.language.getMessage(variables.languagecode, text, optional || {});
// set html language tag // set html language tag
if (variables.languagecode !== 'en_GB' || variables.languagecode !== 'en_US') { if (variables.languagecode !== 'en_GB' || variables.languagecode !== 'en_US') {
@ -57,7 +58,4 @@ Sentry.init({
autoSessionTracking: false, autoSessionTracking: false,
}); });
render( render(<App />, document.getElementById('root'));
<App/>,
document.getElementById('root')
);