diff --git a/package.json b/package.json index 987c7076..2c31f4f8 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@fontsource/montserrat": "4.4.5", "@mui/material": "5.6.0", "@sentry/react": "^6.19.6", + "image-conversion": "^2.1.1", "react": "^18.0.0", "react-clock": "3.1.0", "react-color-gradient-picker": "0.1.2", diff --git a/src/components/modals/main/marketplace/Item.jsx b/src/components/modals/main/marketplace/Item.jsx index 5c12e99f..429b682c 100644 --- a/src/components/modals/main/marketplace/Item.jsx +++ b/src/components/modals/main/marketplace/Item.jsx @@ -190,7 +190,7 @@ export default class Item extends PureComponent { ) : null} - {!this.props.data.data.photos ? ( + {!this.props.data.data.photos && this.props.data.data.language !== "" ? (
diff --git a/src/components/modals/main/scss/marketplace/_main.scss b/src/components/modals/main/scss/marketplace/_main.scss index e6e75ff8..e5d21bd4 100644 --- a/src/components/modals/main/scss/marketplace/_main.scss +++ b/src/components/modals/main/scss/marketplace/_main.scss @@ -28,6 +28,9 @@ box-shadow: 0 0 0 1px t($modal-sidebarActive); &:hover { background: t($modal-sidebarActive); + img { + background: t($modal-sidebarActive); + } } } @@ -39,6 +42,7 @@ height: 80% !important; width: auto !important; border-radius: 12px; + transition: 0.5s; @include themed() { background: t($modal-sidebar); diff --git a/src/components/modals/main/scss/settings/modules/tabs/_changelog.scss b/src/components/modals/main/scss/settings/modules/tabs/_changelog.scss index 15e79e7e..1366f541 100644 --- a/src/components/modals/main/scss/settings/modules/tabs/_changelog.scss +++ b/src/components/modals/main/scss/settings/modules/tabs/_changelog.scss @@ -1,5 +1,6 @@ .updateChangelog { max-width: 75%; + white-space: pre-wrap; li { cursor: initial; diff --git a/src/components/modals/main/settings/FileUpload.jsx b/src/components/modals/main/settings/FileUpload.jsx index 444fb386..602c57ad 100644 --- a/src/components/modals/main/settings/FileUpload.jsx +++ b/src/components/modals/main/settings/FileUpload.jsx @@ -1,6 +1,7 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; import { toast } from 'react-toastify'; +import { compressAccurately, filetoDataURL } from 'image-conversion'; export default class FileUpload extends PureComponent { getMessage = (text) => variables.language.getMessage(variables.languagecode, text); @@ -14,16 +15,27 @@ export default class FileUpload extends PureComponent { reader.readAsText(file, 'UTF-8'); } else { // background upload - if (file.size > 2000000) { - return toast(this.getMessage('modals.main.file_upload_error')); - } + const settings = {}; - reader.readAsDataURL(file); + Object.keys(localStorage).forEach((key) => { + settings[key] = localStorage.getItem(key); + }); + + // todo: check for video and ignore (very easy) + // also look into changing the number + const settingsSize = new TextEncoder().encode(JSON.stringify(settings)).length; + compressAccurately(file, 200).then(async (res) => { + if (settingsSize + res.size > 4850000) { + return toast('Not enough storage!'); + } + + this.props.loadFunction({ + target: { + result: await filetoDataURL(res), + }, + }); + }); } - - reader.addEventListener('load', (e) => { - this.props.loadFunction(e); - }); }; } diff --git a/src/components/modals/main/settings/Header.jsx b/src/components/modals/main/settings/Header.jsx index 60bce433..2b084b66 100644 --- a/src/components/modals/main/settings/Header.jsx +++ b/src/components/modals/main/settings/Header.jsx @@ -17,7 +17,11 @@ export default class Header extends PureComponent { <> {this.props.title}
- + + window.open( + variables.constants.KNOWLEDGEBASE + '/' + this.props.setting.toLowerCase().replace('enabled', ''), + '_blank', + )}> More Info -
- - {getMessage('modals.main.settings.sections.appearance.accessibility.widget_zoom')} - - eeeh course -
-
- -
-
*/ -} diff --git a/src/components/modals/main/settings/sections/Changelog.jsx b/src/components/modals/main/settings/sections/Changelog.jsx index 8abd3d6e..c3e4f4bc 100644 --- a/src/components/modals/main/settings/sections/Changelog.jsx +++ b/src/components/modals/main/settings/sections/Changelog.jsx @@ -47,7 +47,7 @@ export default class Changelog extends PureComponent { author: data.authors.join(', '), }, ), - html: data.html, + content: data.markdown, }); // lightbox etc @@ -128,7 +128,9 @@ export default class Changelog extends PureComponent { className="updateImage" /> ) : null} -
+
+ {this.state.content} +
this.setState({ showLightbox: false })} diff --git a/src/components/widgets/navbar/Navbar.jsx b/src/components/widgets/navbar/Navbar.jsx index 5612f83c..96f31b52 100644 --- a/src/components/widgets/navbar/Navbar.jsx +++ b/src/components/widgets/navbar/Navbar.jsx @@ -90,7 +90,9 @@ export default class Navbar extends PureComponent {
- {this.state.todo.map((_value, index) => ( -
- this.updateTodo('done', index)} - /> - this.updateTodo('set', index, data)} - readOnly={this.state.todo[index].done} - /> - this.updateTodo('remove', index)} /> -
- ))} + + {this.state.todo.map((_value, index) => ( +
+ + this.updateTodo('done', index)} + /> + this.updateTodo('set', index, data)} + readOnly={this.state.todo[index].done} + /> + this.updateTodo('remove', index)} /> + + } + /> +
+ ))} +
diff --git a/src/modules/constants.js b/src/modules/constants.js index 13aad0d1..1640cd9b 100644 --- a/src/modules/constants.js +++ b/src/modules/constants.js @@ -11,7 +11,7 @@ export const OPENSTREETMAP_URL = 'https://www.openstreetmap.org'; // Mue URLs export const WEBSITE_URL = 'https://muetab.com'; export const PRIVACY_URL = 'https://muetab.com/privacy'; -export const BLOG_POST = 'https://blog.muetab.com/posts/version-7-0'; +export const BLOG_POST = 'https://blog.muetab.com/posts/version-6-0'; export const TRANSLATIONS_URL = 'https://docs.muetab.com/translations/'; export const REPORT_ITEM = 'https://github.com/mue/marketplace/issues/new?assignees=&labels=item+report&template=item-report.md&title=%5BItem+Report%5D+'; @@ -19,6 +19,7 @@ export const BUG_REPORT = 'https://github.com/mue/mue/issues/new?assignees=&labels=issue+report&template=bug-report.md&title=%5BBug%5D+'; export const DONATE_LINK = 'https://muetab.com/donate'; export const SENTRY_DSN = 'https://430352fd4b174d688ebd82fc85c22c58@o1217438.ingest.sentry.io/6359480'; +export const KNOWLEDGEBASE = 'https://knowledgebase.muetab.com'; // Mue Info export const ORG_NAME = 'mue';