feat: better error feedback in weather, run prettier + lint

This commit is contained in:
David Ralph 2024-02-07 12:39:16 +00:00
parent fba4012875
commit 21184c6c03
18 changed files with 55 additions and 34 deletions

View File

@ -1,7 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"target": "es6" "target": "es6",
}, },
"exclude": ["node_modules"] "exclude": ["node_modules"],
} }

View File

@ -5,6 +5,7 @@ $appsWidth: 21rem;
.appsShortcutContainer { .appsShortcutContainer {
max-height: 35rem; max-height: 35rem;
overflow-y: auto; overflow-y: auto;
// scrollbar-width: thin; // scrollbar-width: thin;
border-radius: 0.8em; border-radius: 0.8em;
padding: 1.2em; padding: 1.2em;

View File

@ -10,10 +10,7 @@
.Overlay { .Overlay {
position: fixed; position: fixed;
z-index: 100; z-index: 100;
top: 0; inset: 0;
left: 0;
right: 0;
bottom: 0;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
display: grid; display: grid;
@ -170,6 +167,7 @@ h5 {
gap: 20px; gap: 20px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.link { .link {
display: flex; display: flex;
flex-flow: row; flex-flow: row;

View File

@ -28,7 +28,8 @@
display: inline; display: inline;
margin-top: 0; margin-top: 0;
float: none !important; float: none !important;
padding: 0 20px 0 20px; padding: 0 20px;
// width: 200px; // width: 200px;
} }

View File

@ -6,13 +6,12 @@
left: 0; left: 0;
position: sticky; position: sticky;
margin: 0; margin: 0;
padding: 0 5px 0 5px; padding: 0 5px;
background: t($modal-sidebar); background: t($modal-sidebar);
border-radius: 12px 0 0 12px; border-radius: 12px 0 0 12px;
overflow-y: auto; overflow: hidden auto;
height: 80vh; height: 80vh;
min-width: 250px; min-width: 250px;
overflow-x: hidden;
.mainTitle { .mainTitle {
text-align: center; text-align: center;

View File

@ -65,9 +65,8 @@
} }
.activityButtons { .activityButtons {
justify-content: space-between !important; place-content: space-between space-between !important;
align-items: flex-end !important; align-items: flex-end !important;
align-content: space-between !important;
flex-flow: row wrap !important; flex-flow: row wrap !important;
button:not(:first-child) { button:not(:first-child) {

View File

@ -1,5 +1,4 @@
@import 'scss/variables'; @import 'scss/variables';
@import 'modules/material-ui'; @import 'modules/material-ui';
@import 'modules/tabs/about'; @import 'modules/tabs/about';
@import 'modules/tabs/changelog'; @import 'modules/tabs/changelog';
@ -140,10 +139,12 @@ h4 {
justify-content: center; justify-content: center;
margin-bottom: 30px; margin-bottom: 30px;
} }
.statGrid { .statGrid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
grid-gap: 10px; grid-gap: 10px;
div { div {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
@ -214,6 +215,7 @@ h4 {
font-weight: bold; font-weight: bold;
font-size: 15px; font-size: 15px;
} }
.subtitle { .subtitle {
font-size: 13px !important; font-size: 13px !important;
} }

View File

@ -173,6 +173,7 @@ legend,
.MuiChip-root { .MuiChip-root {
text-transform: capitalize; text-transform: capitalize;
@include themed { @include themed {
background: t($modal-sidebarActive) !important; background: t($modal-sidebarActive) !important;
color: t($color) !important; color: t($color) !important;

View File

@ -61,6 +61,10 @@ export default class TimeSettings extends PureComponent {
const LocationSetting = () => { const LocationSetting = () => {
const getAuto = () => { const getAuto = () => {
this.setState({
location: variables.getMessage('modals.main.loading'),
});
navigator.geolocation.getCurrentPosition( navigator.geolocation.getCurrentPosition(
async (position) => { async (position) => {
const data = await ( const data = await (

View File

@ -68,11 +68,12 @@
.step { .step {
display: inline-block; display: inline-block;
border-bottom: 2px solid grey; border-bottom: 2px solid grey;
padding: 10px 20px 10px 20px; padding: 10px 20px;
margin: 5px; margin: 5px;
transition: 0.2s ease-in-out; transition: 0.2s ease-in-out;
cursor: pointer; cursor: pointer;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
&:hover { &:hover {
background: #dd4038; background: #dd4038;
border-radius: 10px; border-radius: 10px;
@ -103,8 +104,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
align-content: center; place-content: center center;
justify-content: center;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
@ -197,9 +197,11 @@ a.privacy {
.examples { .examples {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
.shareYourMue { .shareYourMue {
width: fit-content; width: fit-content;
} }
img { img {
max-width: 60%; max-width: 60%;
border-radius: 10px 10px 10px 0; border-radius: 10px 10px 10px 0;
@ -207,9 +209,10 @@ a.privacy {
} }
.shareYourMue { .shareYourMue {
padding: 8px 20px 8px 20px; padding: 8px 20px;
border-radius: 0 0 10px 10px; border-radius: 0 0 10px 10px;
letter-spacing: 2px; letter-spacing: 2px;
@include themed { @include themed {
background-color: t($modal-sidebarActive); background-color: t($modal-sidebarActive);
} }
@ -264,9 +267,10 @@ a.privacy {
.icon { .icon {
background: linear-gradient(238.7deg, #ff5c25 13.8%, #d21a11 49.49%, #ff456e 87.48%); background: linear-gradient(238.7deg, #ff5c25 13.8%, #d21a11 49.49%, #ff456e 87.48%);
/*@include themed {
/* @include themed {
background-color: t($modal-sidebarActive); background-color: t($modal-sidebarActive);
}*/ } */
height: 50px !important; height: 50px !important;
width: 50px !important; width: 50px !important;

View File

@ -459,6 +459,7 @@
display: flex; display: flex;
flex-flow: column; flex-flow: column;
justify-content: space-between; justify-content: space-between;
div { div {
display: flex; display: flex;
flex-flow: row; flex-flow: row;

View File

@ -243,7 +243,13 @@ function TodoWrapper() {
}); });
return ( return (
<Todo todoRef={setReference} floatRef={refs.setFloating} position={strategy} xPosition={x} yPosition={y} /> <Todo
todoRef={setReference}
floatRef={refs.setFloating}
position={strategy}
xPosition={x}
yPosition={y}
/>
); );
} }

View File

@ -108,11 +108,13 @@ textarea {
.notes-buttons { .notes-buttons {
display: flex !important; display: flex !important;
gap: 10px; gap: 10px;
button { button {
&:disabled { &:disabled {
@include themed() { @include themed {
background: t($modal-sidebar) !important; background: t($modal-sidebar) !important;
} }
cursor: not-allowed; cursor: not-allowed;
} }
} }

View File

@ -7,8 +7,7 @@
.todoRows { .todoRows {
max-height: 65vh !important; max-height: 65vh !important;
overflow-y: visible !important; overflow: hidden visible !important;
overflow-x: hidden;
display: flex; display: flex;
flex-flow: column; flex-flow: column;
gap: 15px; gap: 15px;

View File

@ -20,8 +20,7 @@
border-radius: 12px; border-radius: 12px;
z-index: 1; z-index: 1;
display: flex; display: flex;
align-content: center; place-content: center center;
justify-content: center;
gap: 12px; gap: 12px;
textarea { textarea {
@ -151,6 +150,7 @@ button.quicklinks {
.addLinkModal { .addLinkModal {
@extend %tabText; @extend %tabText;
padding: 15px; padding: 15px;
@include themed { @include themed {
@ -159,7 +159,8 @@ button.quicklinks {
button { button {
@include modal-button(standard); @include modal-button(standard);
padding: 10px 30px 10px 30px;
padding: 10px 30px;
float: right; float: right;
} }
@ -182,7 +183,7 @@ button.quicklinks {
grid-template-rows: auto 1fr; /* Two rows: first auto-sized, second filling remaining space */ grid-template-rows: auto 1fr; /* Two rows: first auto-sized, second filling remaining space */
grid-template-columns: repeat(2, 1fr); /* Two equal-width columns for the first row */ grid-template-columns: repeat(2, 1fr); /* Two equal-width columns for the first row */
grid-gap: 10px; /* Optional gap between items */ grid-gap: 10px; /* Optional gap between items */
padding: 15px 0 15px 0; padding: 15px 0;
button { button {
display: flex; display: flex;

View File

@ -115,8 +115,8 @@ export default class Quote extends PureComponent {
stripHTML(html) { stripHTML(html) {
const tmpdoc = new DOMParser().parseFromString(html, 'text/html'); const tmpdoc = new DOMParser().parseFromString(html, 'text/html');
return tmpdoc.body.textContent || ""; return tmpdoc.body.textContent || '';
} }
async getAuthorImg(author) { async getAuthorImg(author) {
if (localStorage.getItem('authorImg') === 'false') { if (localStorage.getItem('authorImg') === 'false') {

View File

@ -41,6 +41,10 @@ export default class Weather extends PureComponent {
); );
if (!response.ok) { if (!response.ok) {
this.setState({
location: variables.getMessage('modals.main.error_boundary.title'),
done: true,
});
throw new Error('Network response was not ok'); throw new Error('Network response was not ok');
} }
@ -49,6 +53,7 @@ export default class Weather extends PureComponent {
if (data.status === 404) { if (data.status === 404) {
return this.setState({ return this.setState({
location: variables.getMessage('widgets.weather.not_found'), location: variables.getMessage('widgets.weather.not_found'),
done: true,
}); });
} }
@ -107,7 +112,7 @@ export default class Weather extends PureComponent {
const weatherType = localStorage.getItem('weatherType') || 1; const weatherType = localStorage.getItem('weatherType') || 1;
if (this.state.location === variables.getMessage('weather.not_found')) { if (!this.state.weather) {
return ( return (
<div className="weather"> <div className="weather">
<span className="loc">{this.state.location}</span> <span className="loc">{this.state.location}</span>

View File

@ -18,10 +18,7 @@ body {
font-size: calc(10px + 2vmin); font-size: calc(10px + 2vmin);
text-align: center; text-align: center;
position: absolute; position: absolute;
top: 0; inset: 0;
bottom: 0;
left: 0;
right: 0;
text-shadow: 0 0 25px rgb(0 0 0 / 30%); text-shadow: 0 0 25px rgb(0 0 0 / 30%);
display: grid; display: grid;
place-items: center; place-items: center;
@ -123,6 +120,7 @@ body {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
button { button {
margin-bottom: 15px; margin-bottom: 15px;
flex-flow: row !important; flex-flow: row !important;