Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
init(callback = () => {}) {
let { config, onUpload } = this.props;
const language = config.language || config.LANGUAGE || CONFIG.language;
// support old config
let activeModules = config.modules || config.MODULES || CONFIG.modules || ["UPLOAD"];
activeModules = activeModules.join('|').replace('UPLOADED_IMAGES', 'MY_GALLERY').split('|');
// end
I18n.setLocale(language);
config.modules = activeModules;
const nextConfig = prepareConfig(config, onUpload);
getTokenSettings(nextConfig)
.then(settings => {
this.props.setAppState(() => ({ ...settings }));
})
.catch(error => {
const response = error && error.response && error.response.data || {};
this.showAlert(response.msg, response.hint, 'error', 10000);
});
this.props.setAppState(() => ({
config: nextConfig,
//
// );
// addDecorator(bootstrapWrapperDecorator);
addDecorator(withInfo);
// Option defaults:
setOptions({
name: 'Assembl',
url: '#',
hierarchySeparator: /\//,
hierarchyRootSeparator: /\|/
});
I18n.setTranslations(messages);
I18n.setLocale('fr');
function loadStories() {
require('../js/app/integration/101/components/button101/button101.stories.jsx');
require('../js/app/integration/101/components/checkbox101/checkbox101.stories.jsx');
require('../js/app/integration/101/components/checkboxList101/checkboxList101.stories.jsx');
require('../js/app/stories/components/common/menu/menu.stories.jsx');
require('../js/app/stories/components/debate/common/toggleCommentButton.stories.jsx');
require('../js/app/stories/components/debate/common/replyToCommentButton.stories.jsx');
require('../js/app/stories/components/debate/common/sharePostButton.stories.jsx');
require('../js/app/stories/components/debate/common/commentHelperButton.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/fictionPreview.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/fictionsList.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/instructionsText.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/circleAvatar.stories.jsx');
import React from 'react'
import ReactDOM from 'react-dom'
import ReactGA from 'react-ga'
import { I18n } from 'react-i18nify'
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import translations from '../assets/translations/translations'
import Home from './containers/Home'
import reducer from './reducer'
import './index.css'
I18n.setTranslations(translations)
I18n.setLocale(
(localStorage.getItem('motada_language') || navigator.language || navigator.userLanguage || 'en').substring(0,2)
)
if(window.location.href.indexOf('localhost') === -1) {
ReactGA.initialize('UA-127688890-1')
ReactGA.pageview(window.location.pathname + window.location.search)
}
ReactDOM.render(
,
document.getElementById('root'),
)
constructor(props: ApplicationProps) {
const { locale } = props;
I18n.setLocale(locale);
super(props);
}
.then(jsonModule => {
I18n.setTranslations({
[i18nConvention]: jsonModule
})
I18n.setLocale(i18nConvention)
this.forceUpdate()
}).catch((error) => {
I18n.setTranslations(this.props.languageDefault)
.then((jsonModule) => {
I18n.setTranslations({
[i18nConvention]: jsonModule,
})
I18n.setLocale(i18nConvention)
this.forceUpdate()
}).catch((error) => {
I18n.setTranslations(this.props.languageDefault)