]> git.localhorst.tv Git - alttp.git/blob - resources/js/app/index.js
twitch chat bot controls
[alttp.git] / resources / js / app / index.js
1 import React from 'react';
2 import { Helmet } from 'react-helmet';
3 import { useTranslation } from 'react-i18next';
4
5 import Routes from './Routes';
6 import AlttpBaseRomProvider from '../helpers/AlttpBaseRomContext';
7 import { UserProvider } from '../hooks/user';
8 import i18n from '../i18n';
9
10 const App = () => {
11         const { t } = useTranslation();
12
13         React.useEffect(() => {
14                 window.Echo.channel('App.Control')
15                         .listen('PleaseRefresh', () => {
16                                 location.reload();
17                         });
18                 return () => {
19                         window.Echo.leave('App.Control');
20                 };
21         }, []);
22
23         return <AlttpBaseRomProvider>
24                 <UserProvider>
25                         <Helmet>
26                                 <html lang={i18n.language} />
27                                 <title>{t('general.appName')}</title>
28                                 <meta name="description" content={t('general.appDescription')} />
29                         </Helmet>
30                         <Routes />
31                 </UserProvider>
32         </AlttpBaseRomProvider>;
33 };
34
35 export default App;