diff --git a/src/components/modals/Main.jsx b/src/components/modals/Main.jsx index 7dce7ccb..ec32f441 100644 --- a/src/components/modals/Main.jsx +++ b/src/components/modals/Main.jsx @@ -6,26 +6,24 @@ import Marketplace from './tabs/Marketplace'; import Navigation from './tabs/backend/Tabs'; -export default class MainModal extends React.PureComponent { - render() { - return ( -
- × -

Options

-
- -
- -
-
- -
-
- -
-
-
+export default function MainModal(props) { + return ( +
+ × +

Options

+
+ +
+ +
+
+ +
+
+ +
+
- ); - } +
+ ); } \ No newline at end of file diff --git a/src/components/modals/marketplace/sections/Added.jsx b/src/components/modals/marketplace/sections/Added.jsx index f127ab3c..d9770728 100644 --- a/src/components/modals/marketplace/sections/Added.jsx +++ b/src/components/modals/marketplace/sections/Added.jsx @@ -5,6 +5,8 @@ import Item from '../Item'; import Items from '../Items'; import FileUpload from '../../settings/FileUpload'; +import MarketplaceFunctions from '../../../../modules/helpers/marketplace'; + export default class Added extends React.PureComponent { constructor(...args) { super(...args); @@ -61,8 +63,32 @@ export default class Added extends React.PureComponent { this.setState({ button: this.buttons.uninstall }); -} + } + manage(type, input) { + switch (type) { + case 'install': + MarketplaceFunctions.install(input.type, input, true); + break; + case 'uninstall': + MarketplaceFunctions.uninstall(this.state.current_data.name, this.state.current_data.content.type); + break; + default: + break; + } + + toast(this.props.toastLanguage[type + 'ed']); + + let button = ''; + if (type === 'install') { + button = this.buttons.uninstall; + } + + this.setState({ + button: button, + installed: JSON.parse(localStorage.getItem('installed')) + }); + } render() { let content = this.toggle('item', 'addon', input)} />; @@ -74,7 +100,7 @@ export default class Added extends React.PureComponent {

Empty

Nothing here (yet)

- +
); @@ -83,7 +109,7 @@ export default class Added extends React.PureComponent { return (
- this.manage('install', JSON.parse(e.target.result))} /> + this.manage('install', JSON.parse(e.target.result))} /> {content}
diff --git a/src/components/modals/tabs/backend/Tab.jsx b/src/components/modals/tabs/backend/Tab.jsx index 4d098e14..b99fff20 100644 --- a/src/components/modals/tabs/backend/Tab.jsx +++ b/src/components/modals/tabs/backend/Tab.jsx @@ -46,6 +46,7 @@ export default class Tab extends React.PureComponent { case 'Settings': icon = ; break; case 'My Add-ons': icon = ; break; case 'Marketplace': icon = ; break; + // Settings case 'Time': icon =