2024-02-08 13:05:37 +00:00
|
|
|
import { createRoot } from 'react-dom/client';
|
2024-02-08 12:57:37 +00:00
|
|
|
|
2022-04-24 10:42:23 +00:00
|
|
|
import * as Sentry from '@sentry/react';
|
2022-04-13 14:25:50 +00:00
|
|
|
|
|
|
|
import App from './App';
|
2024-02-10 10:45:21 +00:00
|
|
|
import ErrorBoundary from './ErrorBoundary';
|
2024-02-18 23:05:15 +00:00
|
|
|
import variables from './config/variables';
|
2022-04-13 14:25:50 +00:00
|
|
|
|
|
|
|
import './scss/index.scss';
|
|
|
|
// the toast css is based on default so we need to import it
|
|
|
|
import 'react-toastify/dist/ReactToastify.min.css';
|
|
|
|
|
2024-02-19 09:42:59 +00:00
|
|
|
import { initTranslations } from 'lib/translations';
|
2022-04-13 14:25:50 +00:00
|
|
|
|
|
|
|
const languagecode = localStorage.getItem('language') || 'en_GB';
|
2023-03-16 15:44:51 +00:00
|
|
|
variables.language = initTranslations(languagecode);
|
2023-03-14 23:53:05 +00:00
|
|
|
variables.languagecode = languagecode;
|
|
|
|
document.documentElement.lang = languagecode.replace('_', '-');
|
2022-04-13 14:25:50 +00:00
|
|
|
|
2022-11-06 11:59:59 +00:00
|
|
|
variables.getMessage = (text, optional) =>
|
|
|
|
variables.language.getMessage(variables.languagecode, text, optional || {});
|
2022-08-26 09:45:32 +00:00
|
|
|
|
2022-04-24 10:42:23 +00:00
|
|
|
Sentry.init({
|
|
|
|
dsn: variables.constants.SENTRY_DSN,
|
|
|
|
defaultIntegrations: false,
|
2022-05-11 15:09:26 +00:00
|
|
|
autoSessionTracking: false,
|
2022-04-24 10:42:23 +00:00
|
|
|
});
|
|
|
|
|
2024-02-08 12:16:30 +00:00
|
|
|
const container = document.getElementById('root');
|
2024-02-08 13:05:37 +00:00
|
|
|
const root = createRoot(container);
|
2024-02-10 10:45:21 +00:00
|
|
|
root.render(
|
|
|
|
<ErrorBoundary>
|
|
|
|
<App />
|
|
|
|
</ErrorBoundary>,
|
|
|
|
);
|