diff --git a/src/App.jsx b/src/App.jsx
index cbcd1723..e3a9b5cd 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -12,7 +12,7 @@ import Date from './components/widgets/Date';
import Navbar from './components/Navbar';
-import SettingsFunctions from './modules/helpers/settings';
+import SettingsFunctions from './modules/helpers/Settings';
import { ToastContainer } from 'react-toastify';
import Modal from 'react-modal';
import merge from 'lodash.merge';
diff --git a/src/components/modals/MainModal.jsx b/src/components/modals/MainModal.jsx
index c9d0428d..426bbf4b 100644
--- a/src/components/modals/MainModal.jsx
+++ b/src/components/modals/MainModal.jsx
@@ -55,8 +55,7 @@ export default class MainModal extends React.PureComponent {
settingsActive: ''
});
break;
- default:
- break;
+ default: break;
}
}
@@ -73,6 +72,6 @@ export default class MainModal extends React.PureComponent {
{this.state.tab}
- )
+ );
}
}
\ No newline at end of file
diff --git a/src/components/modals/Update.jsx b/src/components/modals/Update.jsx
index 0d09aa33..0bac3dfe 100644
--- a/src/components/modals/Update.jsx
+++ b/src/components/modals/Update.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import * as Constants from '../../modules/constants';
+import * as Constants from '../../modules/Constants';
export default class Update extends React.PureComponent {
constructor(...args) {
diff --git a/src/components/modals/Welcome.jsx b/src/components/modals/Welcome.jsx
index c4c33129..3626720a 100644
--- a/src/components/modals/Welcome.jsx
+++ b/src/components/modals/Welcome.jsx
@@ -21,7 +21,7 @@ export default class Welcome extends React.PureComponent {
-
+
);
}
}
\ No newline at end of file
diff --git a/src/components/modals/settings/Checkbox.jsx b/src/components/modals/settings/Checkbox.jsx
index 25a1d11c..41c4efd9 100644
--- a/src/components/modals/settings/Checkbox.jsx
+++ b/src/components/modals/settings/Checkbox.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import SettingsFunctions from '../../../modules/helpers/settings';
+import SettingsFunctions from '../../../modules/helpers/Settings';
import CheckboxUI from '@material-ui/core/Checkbox';
import FormControlLabel from '@material-ui/core/FormControlLabel';
diff --git a/src/components/modals/settings/Section.jsx b/src/components/modals/settings/Section.jsx
index 47bd9a97..9634fd36 100644
--- a/src/components/modals/settings/Section.jsx
+++ b/src/components/modals/settings/Section.jsx
@@ -13,29 +13,27 @@ export default class Section extends React.PureComponent {
toggleSection() {
const display = (this.state.display === 'none') ? 'block': 'none';
- const transform = (this.state.transform === 'rotate(0)') ? 'rotate(-180deg)' : 'rotate(0)';
this.setState({
display: display,
- transform: transform
+ transform: (this.state.transform === 'rotate(0)') ? 'rotate(-180deg)' : 'rotate(0)'
});
- if (this.props.onToggle) {
- this.props.onToggle(display);
- }
+ if (this.props.onToggle) this.props.onToggle(display);
}
render() {
let extraHTML, expandMore, slider, noDropdown;
+
if (this.props.children) {
extraHTML =
{this.props.children}
- expandMore = this.toggleSection()}
- />;
+ expandMore = (
+ this.toggleSection()} />
+ );
}
-
if (this.props.slider !== false) slider = ;
if (this.props.noDropdown) noDropdown = 'nodropdown';
diff --git a/src/components/modals/settings/Slider.jsx b/src/components/modals/settings/Slider.jsx
index 2826d475..8ca4bf3b 100644
--- a/src/components/modals/settings/Slider.jsx
+++ b/src/components/modals/settings/Slider.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import SettingsFunctions from '../../../modules/helpers/settings';
+import SettingsFunctions from '../../../modules/helpers/Settings';
export default class Slider extends React.PureComponent {
constructor(...args) {
diff --git a/src/components/modals/settings/sections/BackgroundSettings.jsx b/src/components/modals/settings/sections/BackgroundSettings.jsx
index 6deefd51..97ca0921 100644
--- a/src/components/modals/settings/sections/BackgroundSettings.jsx
+++ b/src/components/modals/settings/sections/BackgroundSettings.jsx
@@ -7,6 +7,9 @@ import { ColorPicker } from 'react-color-gradient-picker';
import hexToRgb from '../../../../modules/helpers/background/hexToRgb';
import rgbToHex from '../../../../modules/helpers/background/rgbToHex';
+import 'react-color-gradient-picker/dist/index.css';
+import '../../../../scss/react-color-picker-gradient-picker-custom-styles.scss';
+
export default class BackgroundSettings extends React.PureComponent {
DefaultGradientSettings = { "angle": "180", "gradient": [{ "colour": this.props.language.background.disabled, "stop": 0 }], "type": "linear" };
GradientPickerInitalState = undefined;
@@ -171,7 +174,8 @@ export default class BackgroundSettings extends React.PureComponent {
this.onGradientChange(event, i)} value={g.colour}>
-
);
+
+ );
});
}
colourSettings = (
@@ -180,7 +184,8 @@ export default class BackgroundSettings extends React.PureComponent {
{this.state.gradientSettings.gradient[0].colour !== this.props.language.background.disabled &&
!gradientHasMoreThanOneColour ? () : null
}
- );
+
+ );
}
return (
diff --git a/src/components/modals/settings/sections/LanguageSettings.jsx b/src/components/modals/settings/sections/LanguageSettings.jsx
index 0bc2ec7c..16c75288 100644
--- a/src/components/modals/settings/sections/LanguageSettings.jsx
+++ b/src/components/modals/settings/sections/LanguageSettings.jsx
@@ -9,8 +9,7 @@ export default class LanguageSettings extends React.PureComponent {
localStorage.setItem('language', document.getElementById('language').value)}
- >
+ onChange={() => localStorage.setItem('language', document.getElementById('language').value)} >
diff --git a/src/components/modals/settings/sections/SearchSettings.jsx b/src/components/modals/settings/sections/SearchSettings.jsx
index bd2c9177..69f4cbb2 100644
--- a/src/components/modals/settings/sections/SearchSettings.jsx
+++ b/src/components/modals/settings/sections/SearchSettings.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import SettingsFunctions from '../../../../modules/helpers/settings';
+import SettingsFunctions from '../../../../modules/helpers/Settings';
import { toast } from 'react-toastify';
import Section from '../Section';
import Dropdown from '../Dropdown';
@@ -31,8 +31,7 @@ export default class SearchSettings extends React.PureComponent {
SettingsFunctions.setSearchEngine(document.getElementById('searchEngine').value)}
- >
+ onChange={() => SettingsFunctions.setSearchEngine(document.getElementById('searchEngine').value)} >
{searchEngines.map((engine) =>
)}
diff --git a/src/components/modals/tabs/Addons.jsx b/src/components/modals/tabs/Addons.jsx
index 7569baf0..6cdf5a0c 100644
--- a/src/components/modals/tabs/Addons.jsx
+++ b/src/components/modals/tabs/Addons.jsx
@@ -3,13 +3,13 @@ import LocalMallIcon from '@material-ui/icons/LocalMall';
import { toast } from 'react-toastify';
import Item from '../marketplace/Item';
import Items from '../marketplace/Items';
-import MarketplaceFunctions from '../../../modules/helpers/marketplace';
+import MarketplaceFunctions from '../../../modules/helpers/Marketplace';
export default class Addons extends React.PureComponent {
constructor(...args) {
super(...args);
this.state = {
- installed: [],
+ installed: JSON.parse(localStorage.getItem('installed')),
current_data: {
type: '',
name: '',
@@ -26,7 +26,7 @@ export default class Addons extends React.PureComponent {
button: ''
}
this.buttons = {
- uninstall: ,
+ uninstall: ,
}
}
@@ -55,38 +55,24 @@ export default class Addons extends React.PureComponent {
this.setState({ button: this.buttons.uninstall });
}
- uninstall() {
- let type, data = this.state.current_data.content.type;
- switch (data) {
- case 'photos': type = 'photo_packs'; break;
- case 'quotes': type = 'quote_packs'; break;
- default: type = this.state.current_data.type; break;
- }
- MarketplaceFunctions.uninstall(this.state.current_data.name, type);
- toast(this.props.toastLanguage.uninstalled);
- this.setState({
- button: '',
- installed: JSON.parse(localStorage.getItem('installed'))
- });
- }
-
- install(input) {
- MarketplaceFunctions.install(input.type, input, true);
- toast(this.props.toastLanguage.installed);
- this.setState({
- button: this.buttons.uninstall,
- installed: JSON.parse(localStorage.getItem('installed'))
- });
+ 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')) });
+ }
componentDidMount() {
document.getElementById('file-input').onchange = (e) => {
const reader = new FileReader();
reader.readAsText(e.target.files[0], 'UTF-8');
- reader.onload = (readerEvent) => this.install(JSON.parse(readerEvent.target.result));
+ reader.onload = (readerEvent) => this.manage('install', JSON.parse(readerEvent.target.result));
};
-
- this.setState({ installed: JSON.parse(localStorage.getItem('installed')) });
}
render() {
@@ -96,25 +82,25 @@ export default class Addons extends React.PureComponent {
content = (
-
-
{this.props.language.empty.title}
-
{this.props.language.empty.description}
-
+
+
{this.props.language.empty.title}
+
{this.props.language.empty.description}
+
);
}
return (
-
+ - this.toggle()} language={this.props.marketplaceLanguage.product} />
+
+ );
}
-}
+}
\ No newline at end of file
diff --git a/src/components/modals/tabs/Marketplace.jsx b/src/components/modals/tabs/Marketplace.jsx
index 27830d19..7d69e028 100644
--- a/src/components/modals/tabs/Marketplace.jsx
+++ b/src/components/modals/tabs/Marketplace.jsx
@@ -3,8 +3,8 @@ import WifiOffIcon from '@material-ui/icons/WifiOff';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import { toast } from 'react-toastify';
import Item from '../marketplace/Item';
-import MarketplaceFunctions from '../../../modules/helpers/marketplace';
-import * as Constants from '../../../modules/constants';
+import MarketplaceFunctions from '../../../modules/helpers/Marketplace';
+import * as Constants from '../../../modules/Constants';
import Items from '../marketplace/Items';
export default class Marketplace extends React.PureComponent {
diff --git a/src/components/modals/tabs/Settings.jsx b/src/components/modals/tabs/Settings.jsx
index 79c084bb..029fcef4 100644
--- a/src/components/modals/tabs/Settings.jsx
+++ b/src/components/modals/tabs/Settings.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import SettingsFunctions from '../../../modules/helpers/settings';
+import SettingsFunctions from '../../../modules/helpers/Settings';
import Checkbox from '../settings/Checkbox';
import Section from '../settings/Section';
import { toast } from 'react-toastify';
diff --git a/src/components/widgets/Background.jsx b/src/components/widgets/Background.jsx
index 84c15f24..fa99f57b 100644
--- a/src/components/widgets/Background.jsx
+++ b/src/components/widgets/Background.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import * as Constants from '../../modules/constants';
+import * as Constants from '../../modules/Constants';
export default class Background extends React.PureComponent {
gradientStyleBuilder(gradientSettings) {
@@ -80,11 +80,10 @@ export default class Background extends React.PureComponent {
this.setBackground(randomPhoto.url.default, null, randomPhoto.photographer);
this.setCredit(randomPhoto.photographer);
document.getElementById('location').textContent = randomPhoto.location;
- } else if (customBackgroundColour) {
- this.setBackground(null, customBackgroundColour, 'false');
- } else if (customBackground !== '') { // Local
- this.setBackground(customBackground, null, 'false');
- } else if (customBackgroundVideo) {
+ }
+ else if (customBackgroundColour) this.setBackground(null, customBackgroundColour, 'false');
+ else if (customBackground !== '') this.setBackground(customBackground, null, 'false'); // Local
+ else if (customBackgroundVideo) {
document.getElementById('backgroundImage').innerHTML = `