diff --git a/src/components/modals/main/scss/settings/_main.scss b/src/components/modals/main/scss/settings/_main.scss index f5e70772..d421df73 100644 --- a/src/components/modals/main/scss/settings/_main.scss +++ b/src/components/modals/main/scss/settings/_main.scss @@ -3,7 +3,7 @@ } input { - &[type=text] { + &[type=text] { width: 200px; color: var(--modal-text); background: var(--sidebar); diff --git a/src/components/modals/main/settings/Dropdown.jsx b/src/components/modals/main/settings/Dropdown.jsx index 7b33b358..12eb0a58 100644 --- a/src/components/modals/main/settings/Dropdown.jsx +++ b/src/components/modals/main/settings/Dropdown.jsx @@ -4,7 +4,8 @@ export default class Dropdown extends React.PureComponent { constructor(props) { super(props); this.state = { - value: localStorage.getItem(this.props.name) || '' + value: localStorage.getItem(this.props.name) || '', + title: '' }; } @@ -16,7 +17,8 @@ export default class Dropdown extends React.PureComponent { const { value } = e.target; this.setState({ - value: value + value: value, + title: e.target[e.target.selectedIndex].text }); localStorage.setItem(this.props.name, value); @@ -26,11 +28,19 @@ export default class Dropdown extends React.PureComponent { } } + // todo: find a better way to do this + componentDidMount() { + const element = document.getElementById(this.props.name); + this.setState({ + title: element[element.selectedIndex].text + }); + } + render() { return ( <> {this.getLabel()} - {this.props.children} diff --git a/src/components/modals/main/settings/ResetModal.jsx b/src/components/modals/main/settings/ResetModal.jsx index 616439ed..fb039d0e 100644 --- a/src/components/modals/main/settings/ResetModal.jsx +++ b/src/components/modals/main/settings/ResetModal.jsx @@ -3,14 +3,16 @@ import React from 'react'; import SettingsFunctions from '../../../../modules/helpers/settings'; export default function ResetModal(props) { + const language = window.language.modals.main.settings.sections.advanced.reset_modal; + return ( <> -

WARNING

-

Do you want to reset Mue?

-

This will delete all data. If you want to keep your data and preferences, please export first.

+

{language.title}

+

{language.question}

+

{language.information}

- - + +
); diff --git a/src/components/modals/main/settings/sections/About.jsx b/src/components/modals/main/settings/sections/About.jsx index 922726f4..22c643f2 100644 --- a/src/components/modals/main/settings/sections/About.jsx +++ b/src/components/modals/main/settings/sections/About.jsx @@ -76,13 +76,13 @@ export default class About extends React.PureComponent { {this.state.loading} {this.state.contributors.map((item) => ( - {item.login} + {item.login}/ ))} { // for those who contributed without opening a pull request this.state.other_contributors.map((item) => ( - {item.login} + {item.login}/ ))}

{this.language.supporters}

diff --git a/src/components/modals/main/tabs/Addons.jsx b/src/components/modals/main/tabs/Addons.jsx index 0bf4d638..084bcf71 100644 --- a/src/components/modals/main/tabs/Addons.jsx +++ b/src/components/modals/main/tabs/Addons.jsx @@ -8,7 +8,7 @@ export default function Addons() { return (
-
+
); } diff --git a/src/modules/helpers/marketplace.js b/src/modules/helpers/marketplace.js index d4e9c182..94719256 100644 --- a/src/modules/helpers/marketplace.js +++ b/src/modules/helpers/marketplace.js @@ -1,5 +1,3 @@ -import { toast } from 'react-toastify'; - export default class MarketplaceFunctions { // based on https://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links static urlParser (input) { @@ -8,80 +6,9 @@ export default class MarketplaceFunctions { } static uninstall(name, type) { - switch (type) { - case 'settings': - const oldSettings = JSON.parse(localStorage.getItem('backup_settings')); - localStorage.clear(); - oldSettings.forEach(item => localStorage.setItem(item.name, item.value)); - break; - case 'quote_packs': - localStorage.removeItem('quote_packs'); - localStorage.removeItem('quoteAPI'); - break; - default: - try { - localStorage.removeItem(type); - } catch (e) { - toast('Failed to uninstall addon, check the console'); - console.error(e); - } - } - let installed = JSON.parse(localStorage.getItem('installed')); - for (let i = 0; i < installed.length; i++) { - if (installed[i].name === name) { - installed.splice(i, 1); - break; - } - } - localStorage.setItem('installed', JSON.stringify(installed)); } static install(type, input, sideload) { - switch (type) { - case 'settings': - localStorage.removeItem('backup_settings'); - - let oldSettings = []; - for (const key of Object.keys(localStorage)) { - oldSettings.push({ - name: key, - value: localStorage.getItem(key) - }); - } - - localStorage.setItem('backup_settings', JSON.stringify(oldSettings)); - input.settings.forEach(element => localStorage.setItem(element.name, element.value)); - break; - - case 'photo_packs': - localStorage.setItem('photo_packs', JSON.stringify(input.photos)); - break; - - case 'quote_packs': - if (input.quote_api) { - localStorage.setItem('quoteAPI', JSON.stringify(input.quote_api)); - } - - localStorage.setItem('quote_packs', JSON.stringify(input.quotes)); - break; - default: - break; - } - - let installed = JSON.parse(localStorage.getItem('installed')); - - if (sideload) { - installed.push({ - content: { - updated: 'Unpublished', - data: input - } - }); - } else { - installed.push(input); - } - - localStorage.setItem('installed', JSON.stringify(installed)); } } diff --git a/src/scss/modules/_marketplace.scss b/src/scss/modules/_marketplace.scss index 6844f755..ef2373e3 100644 --- a/src/scss/modules/_marketplace.scss +++ b/src/scss/modules/_marketplace.scss @@ -76,8 +76,8 @@ p.author { } } -#item > h1, -#item > .MuiSvgIcon-root { +#item>h1, +#item>.MuiSvgIcon-root { display: inline; font-size: 35px !important; } @@ -132,7 +132,7 @@ p.description { background: #2d3436; } -#item > img { +#item>img { border-radius: 24px; height: 200px; width: auto; diff --git a/src/translations/en_GB.json b/src/translations/en_GB.json index f0e2b4cf..ac70ba12 100644 --- a/src/translations/en_GB.json +++ b/src/translations/en_GB.json @@ -56,7 +56,7 @@ "hour_marks": "Hour Marks", "minute_marks": "Minute Marks" }, - "percentage_complete": "Percentage of the Day Complete", + "percentage_complete": "Percentage Complete", "date": { "title": "Date", "day_of_week": "Day of week", @@ -182,6 +182,12 @@ "title": "Advanced", "offline_mode": "Offline Mode", "data": "Data", + "reset_modal": { + "title": "WARNING", + "question": "Do you want to reset Mue?", + "information": "This will delete all data. If you wish to keep your data and preferences, please export them first.", + "cancel": "Cancel" + }, "customisation": "Customisation", "custom_css": "Custom CSS", "custom_js": "Custom JS",