bigbuffet-rw/app/soapbox/main.tsx

49 lines
1.4 KiB
TypeScript
Raw Normal View History

2023-01-23 14:51:50 -08:00
import './polyfills';
2022-04-05 12:43:29 -07:00
import * as OfflinePluginRuntime from '@lcdp/offline-plugin/runtime';
2020-03-27 13:59:38 -07:00
import React from 'react';
import { createRoot } from 'react-dom/client';
2022-11-15 12:48:54 -08:00
import * as BuildConfig from 'soapbox/build-config';
import { printConsoleWarning } from 'soapbox/utils/console';
2023-01-16 12:08:40 -08:00
import '@fontsource/inter/200.css';
import '@fontsource/inter/300.css';
import '@fontsource/inter/400.css';
import '@fontsource/inter/500.css';
import '@fontsource/inter/600.css';
import '@fontsource/inter/700.css';
import '@fontsource/inter/900.css';
import '@fontsource/roboto-mono/400.css';
import 'line-awesome/dist/font-awesome-line-awesome/css/all.css';
import 'react-datepicker/dist/react-datepicker.css';
import '../soapbox/iframe';
import '../styles/application.scss';
2023-01-17 19:24:11 -08:00
import '../styles/tailwind.css';
import './precheck';
2022-01-10 14:01:24 -08:00
import { default as Soapbox } from './containers/soapbox';
2021-09-08 13:45:44 -07:00
import * as monitoring from './monitoring';
2020-03-27 13:59:38 -07:00
import ready from './ready';
2022-06-23 15:53:04 -07:00
// Sentry
monitoring.start();
2021-09-08 13:45:44 -07:00
// Print console warning
if (BuildConfig.NODE_ENV === 'production') {
printConsoleWarning();
}
2020-03-27 13:59:38 -07:00
ready(() => {
const container = document.getElementById('soapbox') as HTMLElement;
const root = createRoot(container);
2021-09-05 14:42:48 -07:00
root.render(<Soapbox />);
2020-03-27 13:59:38 -07:00
if (BuildConfig.NODE_ENV === 'production') {
// avoid offline in dev mode because it's harder to debug
// https://github.com/NekR/offline-plugin/pull/201#issuecomment-285133572
OfflinePluginRuntime.install();
}
});