From 3a6950c1ba10ac8cd597464e698be279b9840a66 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Wed, 27 Apr 2022 16:30:54 +0100 Subject: [PATCH] fix: various modal tab fixes and changes, reorder some settings, fix marketplace --- .../modals/main/marketplace/Items.jsx | 4 +- .../main/marketplace/sections/Create.jsx | 118 +----------------- .../main/marketplace/sections/Sideload.jsx | 9 +- .../modals/main/scss/marketplace/_main.scss | 18 +-- .../modals/main/settings/SettingsItem.jsx | 4 - .../modals/main/settings/sections/About.jsx | 4 +- .../main/settings/sections/Advanced.jsx | 10 +- .../main/settings/sections/Appearance.jsx | 2 +- .../modals/main/settings/sections/Date.jsx | 14 ++- .../main/settings/sections/Greeting.jsx | 10 +- .../modals/main/settings/sections/Navbar.jsx | 2 +- .../main/settings/sections/QuickLinks.jsx | 2 +- .../modals/main/settings/sections/Quote.jsx | 29 ++--- .../modals/main/settings/sections/Search.jsx | 4 +- .../modals/main/settings/sections/Stats.jsx | 1 + .../modals/main/settings/sections/Time.jsx | 7 +- .../sections/background/Background.jsx | 55 ++++---- src/modules/helpers/marketplace.js | 12 +- 18 files changed, 95 insertions(+), 210 deletions(-) diff --git a/src/components/modals/main/marketplace/Items.jsx b/src/components/modals/main/marketplace/Items.jsx index d28fd520..9c9ab604 100644 --- a/src/components/modals/main/marketplace/Items.jsx +++ b/src/components/modals/main/marketplace/Items.jsx @@ -1,5 +1,5 @@ import variables from 'modules/variables'; -import { MdOpenInNew, MdAutoFixHigh } from 'react-icons/md'; +import { MdAutoFixHigh } from 'react-icons/md'; export default function Items({ type, @@ -41,7 +41,7 @@ export default function Items({ ))} - {type === 'all' ? ( + {type === 'all' && !onCollection ? (
Can't find what you're looking for? diff --git a/src/components/modals/main/marketplace/sections/Create.jsx b/src/components/modals/main/marketplace/sections/Create.jsx index bcf4f4dd..87f1a008 100644 --- a/src/components/modals/main/marketplace/sections/Create.jsx +++ b/src/components/modals/main/marketplace/sections/Create.jsx @@ -1,7 +1,3 @@ -// warning: this file is even worse than Background.jsx -// if anyone wants to rewrite it to be actually decent, feel free -// otherwise it will be cleaned up probably when alex asks me to add something here :( -// - david import variables from 'modules/variables'; import { PureComponent } from 'react'; import { @@ -22,7 +18,6 @@ import { saveFile } from 'modules/helpers/settings/modals'; import Tooltip from '../../../../helpers/tooltip/Tooltip'; import FileUpload from '../../settings/FileUpload'; -import Dropdown from '../../settings/Dropdown'; import '../../../welcome/welcome.scss'; @@ -53,7 +48,7 @@ export default class Create extends PureComponent { return this.setState({ currentTab: tab, addonMetadata: { - type: type, + type }, }); } else { @@ -96,47 +91,6 @@ export default class Create extends PureComponent { toast(variables.language.getMessage(variables.languagecode, 'toasts.imported')); } - updateQuotePackType(type) { - const addonMetadata = { - type, - name: this.state.addonMetadata.name, - description: this.state.addonMetadata.description, - version: this.state.addonMetadata.version, - author: this.state.addonMetadata.author, - icon_url: this.state.addonMetadata.icon_url, - screenshot_url: this.state.addonMetadata.screenshot_url, - }; - if (type === 'quotePack') { - this.setState({ - addonMetadata: { - addonMetadata, - quotes: [], - }, - }); - } else { - this.setState({ - addonMetadata: { - addonMetadata, - }, - addonData: { - url: '', - name: '', - author: '', - }, - }); - } - } - - updateQuotePackAPI(type, data) { - this.setState({ - addonData: { - url: type === 'url' ? data : this.state.addonData.url || '', - name: type === 'name' ? data : this.state.addonData.name || '', - author: type === 'author' ? data : this.state.addonData.author || '', - }, - }); - } - importQuotes() { this.setState({ addonData: JSON.parse(localStorage.getItem('customQuote')) || [], @@ -175,7 +129,7 @@ export default class Create extends PureComponent { name: this.state.addonMetadata.name, description: this.state.addonMetadata.description, type: - this.state.addonMetadata.type === 'quote_api' ? 'quotes' : this.state.addonMetadata.type, + this.state.addonMetadata.type, version: this.state.addonMetadata.version, author: this.state.addonMetadata.author, icon_url: this.state.addonMetadata.icon_url, @@ -264,7 +218,6 @@ export default class Create extends PureComponent {
- - this.updateQuotePackType(e)} - > - - - - - {this.state.addonMetadata.type === 'quote_api' ? ( - <> - this.updateQuotePack(e.target.value, 'url')} - /> - this.updateQuotePack(e.target.value, 'name')} - /> - this.updateQuotePack(e.target.value, 'author')} - /> -
-
- - ) : ( + - )}
- {/**/} ); diff --git a/src/components/modals/main/marketplace/sections/Sideload.jsx b/src/components/modals/main/marketplace/sections/Sideload.jsx index 3d67bef0..6e124185 100644 --- a/src/components/modals/main/marketplace/sections/Sideload.jsx +++ b/src/components/modals/main/marketplace/sections/Sideload.jsx @@ -1,6 +1,6 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; -import { MdIntegrationInstructions } from 'react-icons/md'; +import { MdIntegrationInstructions, MdOutlineFileUpload } from 'react-icons/md'; import { toast } from 'react-toastify'; import Modal from 'react-modal'; @@ -70,14 +70,13 @@ export default class Sideload extends PureComponent { accept="application/json" loadFunction={(e) => this.installAddon(JSON.parse(e.target.result))} /> - + {this.getMessage('modals.main.addons.sideload.title')} - idk something about it + Install a Mue addon not on the marketplace from your computer variables.language.getMessage(variables.languageCode, text);*/ return (
{props.title} {props.subtitle} - {/*{getMessage('modals.main.settings.buttons.reset')}*/}
{props.children}
diff --git a/src/components/modals/main/settings/sections/About.jsx b/src/components/modals/main/settings/sections/About.jsx index f9b6c0a9..e9c83eee 100644 --- a/src/components/modals/main/settings/sections/About.jsx +++ b/src/components/modals/main/settings/sections/About.jsx @@ -268,7 +268,7 @@ export default class About extends PureComponent { -
+
{this.getMessage('modals.main.settings.sections.about.resources_used.title')} @@ -351,7 +351,7 @@ export default class About extends PureComponent { })}
-
+
{this.getMessage('modals.main.settings.sections.about.photographers')} diff --git a/src/components/modals/main/settings/sections/Advanced.jsx b/src/components/modals/main/settings/sections/Advanced.jsx index 276278c2..1c050e8a 100644 --- a/src/components/modals/main/settings/sections/Advanced.jsx +++ b/src/components/modals/main/settings/sections/Advanced.jsx @@ -35,10 +35,9 @@ export default class AdvancedSettings extends PureComponent { {getMessage('modals.main.settings.sections.advanced.title')} - + @@ -49,7 +48,7 @@ export default class AdvancedSettings extends PureComponent { {getMessage('modals.main.settings.sections.advanced.data')} - {getMessage('modals.main.settings.sections.advanced.experimental_warning')} + Choose whether to export your Mue settings to your computer, import an existing settings file, or reset your settings to their default values.
@@ -83,7 +82,7 @@ export default class AdvancedSettings extends PureComponent { ))} - + importSettings(e)} /> - + */} - + this.setState({ dateType: value })} @@ -94,7 +94,16 @@ export default class DateSettings extends PureComponent { - + + {this.state.dateType === 'long' ? longSettings : shortSettings} - {(this.state.dateType === 'long') ? longSettings : shortSettings} ); diff --git a/src/components/modals/main/settings/sections/Greeting.jsx b/src/components/modals/main/settings/sections/Greeting.jsx index 676fade0..8a9825c6 100644 --- a/src/components/modals/main/settings/sections/Greeting.jsx +++ b/src/components/modals/main/settings/sections/Greeting.jsx @@ -38,7 +38,7 @@ export default class GreetingSettings extends PureComponent { /> - {/*

{getMessage('modals.main.settings.sections.greeting.birthday')}

- -
- -

{getMessage('modals.main.settings.sections.greeting.birthday_date')}

- */} ); } diff --git a/src/components/modals/main/settings/sections/Navbar.jsx b/src/components/modals/main/settings/sections/Navbar.jsx index c67a0ce8..97746065 100644 --- a/src/components/modals/main/settings/sections/Navbar.jsx +++ b/src/components/modals/main/settings/sections/Navbar.jsx @@ -23,7 +23,7 @@ export default function Navbar() { zoomSetting="zoomNavbar" zoomCategory="navbar" /> - + - +