refactor: imports etc

This commit is contained in:
David Ralph
2021-08-14 20:10:48 +01:00
parent 1a8bb69288
commit 39751736ca
55 changed files with 403 additions and 423 deletions

View File

@@ -1,5 +1,4 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { render } from 'react-dom';
import App from './App';
import * as Constants from './modules/constants';
@@ -12,8 +11,6 @@ import 'react-toastify/dist/ReactToastify.min.css';
import Stats from './modules/helpers/stats';
// language
import merge from '@material-ui/utils/esm/deepmerge';
const languagecode = localStorage.getItem('language') || 'en_GB';
// we set things to window. so we avoid passing the translation strings as props to each component
@@ -24,7 +21,7 @@ if (languagecode === 'en') {
}
// these are merged so if a string is untranslated it doesn't break mue
window.language = merge(require('./translations/en_GB.json'), require(`./translations/${window.languagecode}.json`));
window.language = require(`./translations/${window.languagecode}.json`);
// set html language tag
if (window.languagecode !== 'en_GB' || window.languagecode !== 'en_US') {
@@ -42,7 +39,7 @@ if (localStorage.getItem('stats') === 'true') {
}
}
ReactDOM.render(
render(
<App/>,
document.getElementById('root')
);