mirror of https://github.com/mue/mue.git
chore: run prettier
This commit is contained in:
parent
f0968195cb
commit
333aabde1b
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"extends": ["@commitlint/config-conventional"]
|
"extends": ["@commitlint/config-conventional"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,4 +20,4 @@
|
||||||
"background": {
|
"background": {
|
||||||
"service_worker": "background-chrome.js"
|
"service_worker": "background-chrome.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
))}
|
))}
|
||||||
|
@ -80,4 +77,4 @@ function EmblaCarousel({ data }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(EmblaCarousel);
|
export default memo(EmblaCarousel);
|
||||||
|
|
|
@ -48,7 +48,6 @@
|
||||||
height: 190px;
|
height: 190px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.carousel_button {
|
.carousel_button {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -75,4 +74,4 @@
|
||||||
&.next {
|
&.next {
|
||||||
right: 27px;
|
right: 27px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,4 @@ function Notification(props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(Notification);
|
export default memo(Notification);
|
||||||
|
|
|
@ -14,4 +14,4 @@ function Preview(props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(Preview);
|
export default memo(Preview);
|
||||||
|
|
|
@ -113,4 +113,4 @@ function ShareModal({ modalClose, data }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(ShareModal);
|
export default memo(ShareModal);
|
||||||
|
|
|
@ -33,11 +33,11 @@ function Tooltip({ children, title, style, placement, subtitle }) {
|
||||||
className="tooltipTitle"
|
className="tooltipTitle"
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
<span style={{ fontSize: '8px'}}>{subtitle}</span>
|
<span style={{ fontSize: '8px' }}>{subtitle}</span>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(Tooltip);
|
export default memo(Tooltip);
|
||||||
|
|
|
@ -44,4 +44,4 @@ function InfoTooltip({ title, style, placement, subtitle }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(InfoTooltip);
|
export default memo(InfoTooltip);
|
||||||
|
|
|
@ -69,4 +69,4 @@ function MainModal({ modalClose }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(MainModal);
|
export default memo(MainModal);
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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 === '' ||
|
||||||
|
@ -99,4 +97,4 @@ function Items({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(Items);
|
export default memo(Items);
|
||||||
|
|
|
@ -14,4 +14,4 @@ function Lightbox({ modalClose, img }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(Lightbox);
|
export default memo(Lightbox);
|
||||||
|
|
|
@ -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,11 +17,9 @@ 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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(SideloadFailedModal);
|
export default memo(SideloadFailedModal);
|
||||||
|
|
|
@ -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)}
|
||||||
|
|
|
@ -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 ? (
|
||||||
|
|
|
@ -167,7 +167,6 @@ h5 {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.languageSettings {
|
.languageSettings {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
.MuiFormGroup-root {
|
.MuiFormGroup-root {
|
||||||
|
|
|
@ -480,23 +480,22 @@ a.collectionButton {
|
||||||
@include themed() {
|
@include themed() {
|
||||||
background: t($modal-sidebarActive);
|
background: t($modal-sidebarActive);
|
||||||
box-shadow: 0 0 0 3px t($modal-sidebarActive);
|
box-shadow: 0 0 0 3px t($modal-sidebarActive);
|
||||||
background: t($modal-sidebar);
|
background: t($modal-sidebar);
|
||||||
}
|
}
|
||||||
input {
|
input {
|
||||||
all: unset;
|
all: unset;
|
||||||
}
|
}
|
||||||
@include themed() {
|
@include themed() {
|
||||||
|
&:focus-within {
|
||||||
|
background: t($modal-sidebarActive);
|
||||||
|
box-shadow: 0 0 0 1px t($color);
|
||||||
|
}
|
||||||
|
|
||||||
&:focus-within {
|
&:disabled {
|
||||||
background: t($modal-sidebarActive);
|
background: t($modal-sidebarActive);
|
||||||
box-shadow: 0 0 0 1px t($color);
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:disabled {
|
|
||||||
background: t($modal-sidebarActive);
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.inCollection {
|
.inCollection {
|
||||||
|
@ -523,4 +522,3 @@ a.collectionButton {
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ input {
|
||||||
background: none;
|
background: none;
|
||||||
@include themed() {
|
@include themed() {
|
||||||
border: t($modal-sidebarActive) 1px solid;
|
border: t($modal-sidebarActive) 1px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-webkit-color-swatch-wrapper {
|
&::-webkit-color-swatch-wrapper {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -45,4 +45,4 @@ function ResetModal({ modalClose }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(ResetModal);
|
export default memo(ResetModal);
|
||||||
|
|
|
@ -12,4 +12,4 @@ function SettingsItem(props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(SettingsItem);
|
export default memo(SettingsItem);
|
||||||
|
|
|
@ -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(
|
||||||
|
@ -188,4 +211,4 @@ function AppearanceSettings() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(AppearanceSettings);
|
export default memo(AppearanceSettings);
|
||||||
|
|
|
@ -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>
|
||||||
</>,
|
</>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,4 +71,4 @@ function ExperimentalSettings() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(ExperimentalSettings);
|
export default memo(ExperimentalSettings);
|
||||||
|
|
|
@ -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 />
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -121,7 +121,7 @@ export default class QuoteSettings extends PureComponent {
|
||||||
)}
|
)}
|
||||||
onChange={(e) => this.customQuote(e, true, index, 'quote')}
|
onChange={(e) => this.customQuote(e, true, index, 'quote')}
|
||||||
varient="outlined"
|
varient="outlined"
|
||||||
style={{ fontSize: '22px', fontWeight: 'bold'}}
|
style={{ fontSize: '22px', fontWeight: 'bold' }}
|
||||||
/>
|
/>
|
||||||
<TextareaAutosize
|
<TextareaAutosize
|
||||||
value={this.state.customQuote[index].author}
|
value={this.state.customQuote[index].author}
|
||||||
|
@ -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>
|
||||||
|
|
|
@ -60,7 +60,7 @@ export default class TimeSettings extends PureComponent {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const weatherType = localStorage.getItem('weatherType');
|
const weatherType = localStorage.getItem('weatherType');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header
|
<Header
|
||||||
|
@ -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(
|
||||||
|
|
|
@ -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';
|
||||||
|
|
||||||
|
|
|
@ -40,4 +40,4 @@ function CustomURLModal({ modalClose, modalCloseOnly }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(CustomURLModal);
|
export default memo(CustomURLModal);
|
||||||
|
|
|
@ -5,14 +5,14 @@ function ClockSkeleton() {
|
||||||
if (localStorage.getItem('timeType') === 'analogue') {
|
if (localStorage.getItem('timeType') === 'analogue') {
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<></>}>
|
<Suspense fallback={<></>}>
|
||||||
<div className="clockBackground">
|
<div className="clockBackground">
|
||||||
<Analog
|
<Analog
|
||||||
className="analogclock clock-container"
|
className="analogclock clock-container"
|
||||||
value={'2022-10-07T17:00:00+00:00'}
|
value={'2022-10-07T17:00:00+00:00'}
|
||||||
size={50}
|
size={50}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
} else if (localStorage.getItem('timeType') === 'percentageComplete') {
|
} else if (localStorage.getItem('timeType') === 'percentageComplete') {
|
||||||
return <span className="new-clock clock-container clockSkeleton">68%</span>;
|
return <span className="new-clock clock-container clockSkeleton">68%</span>;
|
||||||
|
@ -28,4 +28,4 @@ function ClockSkeleton() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(ClockSkeleton);
|
export default memo(ClockSkeleton);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -4,4 +4,4 @@ function GreetingSkeleton() {
|
||||||
return <span className="greeting">Good Morning</span>;
|
return <span className="greeting">Good Morning</span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(GreetingSkeleton);
|
export default memo(GreetingSkeleton);
|
||||||
|
|
|
@ -11,4 +11,4 @@ function MessageSkeleton() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(MessageSkeleton);
|
export default memo(MessageSkeleton);
|
||||||
|
|
|
@ -23,4 +23,4 @@ function QuicklinksSkeleton() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(QuicklinksSkeleton);
|
export default memo(QuicklinksSkeleton);
|
||||||
|
|
|
@ -18,4 +18,4 @@ function QuoteSkeleton() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(QuoteSkeleton);
|
export default memo(QuoteSkeleton);
|
||||||
|
|
|
@ -56,4 +56,4 @@ function AddModal({ urlError, addLink, closeModal, edit, editData, editLink }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(AddModal);
|
export default memo(AddModal);
|
||||||
|
|
|
@ -30,4 +30,4 @@ function Marketplace(props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(Marketplace);
|
export default memo(Marketplace);
|
||||||
|
|
|
@ -116,4 +116,4 @@ function Settings(props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(Settings);
|
export default memo(Settings);
|
||||||
|
|
|
@ -17,4 +17,4 @@ function ProgressBar({ count, currentTab, switchTab }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(ProgressBar);
|
export default memo(ProgressBar);
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -217,7 +217,6 @@ a.privacy {
|
||||||
animation-timing-function: ease-in;*/
|
animation-timing-function: ease-in;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.welcomeContent {
|
.welcomeContent {
|
||||||
.light {
|
.light {
|
||||||
.toggle.lightTheme {
|
.toggle.lightTheme {
|
||||||
|
|
|
@ -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);
|
||||||
|
@ -268,31 +269,16 @@ export default class Background extends PureComponent {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
Number(
|
Number(
|
||||||
Number(localStorage.getItem('backgroundStartTime')) +
|
Number(localStorage.getItem('backgroundStartTime')) +
|
||||||
Number(localStorage.getItem('backgroundchange')) >=
|
Number(localStorage.getItem('backgroundchange')) >=
|
||||||
Number(Date.now()),
|
Number(Date.now()),
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
const randomPhoto = photoPack[localStorage.getItem('marketplaceNumber')];
|
const randomPhoto = photoPack[localStorage.getItem('marketplaceNumber')];
|
||||||
if (this.state.firstTime !== true) {
|
if (this.state.firstTime !== true) {
|
||||||
this.setState({
|
this.setState({
|
||||||
url: randomPhoto.url.default,
|
|
||||||
type: 'photo_pack',
|
|
||||||
photoInfo: {
|
|
||||||
hidden: false,
|
|
||||||
credit: randomPhoto.photographer,
|
|
||||||
location: randomPhoto.location || 'N/A',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({ firstTime: true });
|
|
||||||
}
|
|
||||||
this.setState({ firstTime: true });
|
|
||||||
} else {
|
|
||||||
localStorage.setItem('marketplaceNumber', randomNumber);
|
|
||||||
return this.setState({
|
|
||||||
url: randomPhoto.url.default,
|
url: randomPhoto.url.default,
|
||||||
type: 'photo_pack',
|
type: 'photo_pack',
|
||||||
photoInfo: {
|
photoInfo: {
|
||||||
|
@ -301,7 +287,22 @@ export default class Background extends PureComponent {
|
||||||
location: randomPhoto.location || 'N/A',
|
location: randomPhoto.location || 'N/A',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({ firstTime: true });
|
||||||
}
|
}
|
||||||
|
this.setState({ firstTime: true });
|
||||||
|
} else {
|
||||||
|
localStorage.setItem('marketplaceNumber', randomNumber);
|
||||||
|
return this.setState({
|
||||||
|
url: randomPhoto.url.default,
|
||||||
|
type: 'photo_pack',
|
||||||
|
photoInfo: {
|
||||||
|
hidden: false,
|
||||||
|
credit: randomPhoto.photographer,
|
||||||
|
location: randomPhoto.location || 'N/A',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -444,7 +445,7 @@ export default class Background extends PureComponent {
|
||||||
this.interval = setInterval(() => {
|
this.interval = setInterval(() => {
|
||||||
const targetTime = Number(Number(localStorage.getItem('backgroundStartTime')) + Number(test));
|
const targetTime = Number(Number(localStorage.getItem('backgroundStartTime')) + Number(test));
|
||||||
const currentTime = Number(Date.now());
|
const currentTime = Number(Date.now());
|
||||||
const type = localStorage.getItem('backgroundType');
|
const type = localStorage.getItem('backgroundType');
|
||||||
|
|
||||||
if (test !== null && test !== 'refresh') {
|
if (test !== null && test !== 'refresh') {
|
||||||
if (currentTime >= targetTime) {
|
if (currentTime >= targetTime) {
|
||||||
|
|
|
@ -296,4 +296,4 @@ function PhotoInformation({ info, url, api }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(PhotoInformation);
|
export default memo(PhotoInformation);
|
||||||
|
|
|
@ -94,7 +94,7 @@ export default class Greeting extends PureComponent {
|
||||||
const birth = new Date(localStorage.getItem('birthday'));
|
const birth = new Date(localStorage.getItem('birthday'));
|
||||||
|
|
||||||
if (birth.getDate() === now.getDate() && birth.getMonth() === now.getMonth()) {
|
if (birth.getDate() === now.getDate() && birth.getMonth() === now.getMonth()) {
|
||||||
if (localStorage.getItem('birthdayage') === 'true' && this.calculateAge(birth) !== 0 ) {
|
if (localStorage.getItem('birthdayage') === 'true' && this.calculateAge(birth) !== 0) {
|
||||||
const text = variables.getMessage('widgets.greeting.birthday').split(' ');
|
const text = variables.getMessage('widgets.greeting.birthday').split(' ');
|
||||||
message = `${text[0]} ${nth(this.calculateAge(birth))} ${text[1]}`;
|
message = `${text[0]} ${nth(this.calculateAge(birth))} ${text[1]}`;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default class Message extends PureComponent {
|
||||||
this.message.current.style.fontSize = `${
|
this.message.current.style.fontSize = `${
|
||||||
1 * Number((localStorage.getItem('zoomMessage') || 100) / 100)
|
1 * Number((localStorage.getItem('zoomMessage') || 100) / 100)
|
||||||
}em`;
|
}em`;
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
messageText: messages[Math.floor(Math.random() * messages.length)],
|
messageText: messages[Math.floor(Math.random() * messages.length)],
|
||||||
});
|
});
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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,
|
||||||
|
@ -96,7 +96,7 @@ class Notes extends PureComponent {
|
||||||
ref={this.props.notesRef}
|
ref={this.props.notesRef}
|
||||||
style={{ fontSize: this.state.zoomFontSize }}
|
style={{ fontSize: this.state.zoomFontSize }}
|
||||||
>
|
>
|
||||||
<MdAssignment className="topicons"/>
|
<MdAssignment className="topicons" />
|
||||||
</button>
|
</button>
|
||||||
{this.state.showNotes && (
|
{this.state.showNotes && (
|
||||||
<span
|
<span
|
||||||
|
@ -161,4 +161,4 @@ function NotesWrapper() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(NotesWrapper);
|
export default memo(NotesWrapper);
|
||||||
|
|
|
@ -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,
|
||||||
|
@ -222,4 +222,4 @@ function TodoWrapper() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(TodoWrapper);
|
export default memo(TodoWrapper);
|
||||||
|
|
|
@ -194,9 +194,9 @@ button.quicklinks {
|
||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
background-image: linear-gradient(to left, rgb(0, 0, 0), transparent, rgb(0, 0, 0)),
|
background-image: linear-gradient(to left, rgb(0, 0, 0), transparent, rgb(0, 0, 0)),
|
||||||
url('https://media.cntraveller.com/photos/615ee85…/16:9/w_2580,c_limit/Best%20Cities%20in%20the%20World%20-%20Grid.jpg');
|
url('https://media.cntraveller.com/photos/615ee85…/16:9/w_2580,c_limit/Best%20Cities%20in%20the%20World%20-%20Grid.jpg');
|
||||||
transition: 0.8s;
|
transition: 0.8s;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 20px 40px;
|
padding: 20px 40px;
|
||||||
@include themed() {
|
@include themed() {
|
||||||
&:hover {
|
&:hover {
|
||||||
background: t($btn-backgroundHover);
|
background: t($btn-backgroundHover);
|
||||||
|
|
|
@ -132,11 +132,16 @@ 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/, '© ');
|
||||||
|
|
||||||
if (license.value === 'Public domain') {
|
if (license.value === 'Public domain') {
|
||||||
authorimglicense = null;
|
authorimglicense = null;
|
||||||
|
@ -196,7 +201,6 @@ export default class Quote extends PureComponent {
|
||||||
customQuote = customQuote
|
customQuote = customQuote
|
||||||
? 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({
|
||||||
|
@ -204,11 +208,11 @@ export default class Quote extends PureComponent {
|
||||||
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,29 +339,29 @@ 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) {
|
||||||
const targetTime = Number(
|
const targetTime = Number(
|
||||||
Number(localStorage.getItem('quoteStartTime')) +
|
Number(localStorage.getItem('quoteStartTime')) +
|
||||||
Number(localStorage.getItem('quotechange')),
|
Number(localStorage.getItem('quotechange')),
|
||||||
);
|
);
|
||||||
const currentTime = Number(Date.now());
|
const currentTime = Number(Date.now());
|
||||||
if (currentTime >= targetTime) {
|
if (currentTime >= targetTime) {
|
||||||
this.setZoom();
|
|
||||||
this.getQuote();
|
|
||||||
localStorage.setItem('quoteStartTime', Date.now());
|
|
||||||
} else {
|
|
||||||
console.log(localStorage.getItem('quotechange'));
|
|
||||||
try {
|
|
||||||
this.setState(JSON.parse(localStorage.getItem('currentQuote')));
|
|
||||||
} catch (e) {
|
|
||||||
this.setZoom();
|
this.setZoom();
|
||||||
this.getQuote();
|
this.getQuote();
|
||||||
|
localStorage.setItem('quoteStartTime', Date.now());
|
||||||
|
} else {
|
||||||
|
console.log(localStorage.getItem('quotechange'));
|
||||||
|
try {
|
||||||
|
this.setState(JSON.parse(localStorage.getItem('currentQuote')));
|
||||||
|
} catch (e) {
|
||||||
|
this.setZoom();
|
||||||
|
this.getQuote();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
EventBus.on('refresh', (data) => {
|
EventBus.on('refresh', (data) => {
|
||||||
|
@ -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());
|
||||||
|
@ -421,7 +428,7 @@ export default class Quote extends PureComponent {
|
||||||
<span className="quote" ref={this.quote}>
|
<span className="quote" ref={this.quote}>
|
||||||
{this.state.quote}
|
{this.state.quote}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{localStorage.getItem('widgetStyle') === 'legacy' ? (
|
{localStorage.getItem('widgetStyle') === 'legacy' ? (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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')}
|
||||||
|
|
|
@ -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>
|
||||||
|
@ -110,4 +107,4 @@ function Expanded({ state, weatherType, variables }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(Expanded);
|
export default memo(Expanded);
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -108,7 +108,7 @@ export default class Weather extends PureComponent {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="weather">
|
<div className="weather">
|
||||||
<div className="top-weather">
|
<div className="top-weather">
|
||||||
|
@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,21 +19,21 @@ function WeatherIcon({ name }) {
|
||||||
// name is the openweathermap icon name, see https://openweathermap.org/weather-conditions
|
// name is the openweathermap icon name, see https://openweathermap.org/weather-conditions
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case '01d':
|
case '01d':
|
||||||
return <WiDaySunny className="weatherIcon"/>;
|
return <WiDaySunny className="weatherIcon" />;
|
||||||
case '01n':
|
case '01n':
|
||||||
return <WiNightClear className="weatherIcon"/>;
|
return <WiNightClear className="weatherIcon" />;
|
||||||
case '02d':
|
case '02d':
|
||||||
return <WiDayCloudy className="weatherIcon" />;
|
return <WiDayCloudy className="weatherIcon" />;
|
||||||
case '02n':
|
case '02n':
|
||||||
return <WiNightCloudy className="weatherIcon"/>;
|
return <WiNightCloudy className="weatherIcon" />;
|
||||||
case '03d':
|
case '03d':
|
||||||
case '03n':
|
case '03n':
|
||||||
return <WiCloud className="weatherIcon"/>;
|
return <WiCloud className="weatherIcon" />;
|
||||||
case '04d':
|
case '04d':
|
||||||
case '04n':
|
case '04n':
|
||||||
return <WiCloudy className="weatherIcon"/>;
|
return <WiCloudy className="weatherIcon" />;
|
||||||
case '09d':
|
case '09d':
|
||||||
return <WiDayShowers className="weatherIcon"/>;
|
return <WiDayShowers className="weatherIcon" />;
|
||||||
case '09n':
|
case '09n':
|
||||||
return <WiNightShowers className="weatherIcon" />;
|
return <WiNightShowers className="weatherIcon" />;
|
||||||
case '10d':
|
case '10d':
|
||||||
|
@ -53,4 +53,4 @@ function WeatherIcon({ name }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(WeatherIcon);
|
export default memo(WeatherIcon);
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -50,4 +49,4 @@ function WindDirectionIcon({ degrees }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(WindDirectionIcon);
|
export default memo(WindDirectionIcon);
|
||||||
|
|
|
@ -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')
|
|
||||||
);
|
|
||||||
|
|
|
@ -693,4 +693,4 @@
|
||||||
"no_storage": "Not enough storage",
|
"no_storage": "Not enough storage",
|
||||||
"link_copied": "Link copied"
|
"link_copied": "Link copied"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue