2020-04-05 14:20:00 +02:00
|
|
|
import React from 'react';
|
|
|
|
import './App.css';
|
|
|
|
|
2020-06-05 22:58:53 +02:00
|
|
|
import { Provider } from '@scripters/use-socket.io';
|
2020-06-07 13:49:04 +02:00
|
|
|
import BoardView from './views/BoardView';
|
2020-06-05 22:58:53 +02:00
|
|
|
import { C2CProvider } from './hooks/useC2C';
|
|
|
|
|
|
|
|
import { RecoilRoot } from 'recoil';
|
|
|
|
|
2020-06-07 13:49:04 +02:00
|
|
|
const SOCKET_URL =
|
|
|
|
process.env.REACT_APP_SOCKET_URL || 'http://192.168.0.14:4000';
|
2020-06-05 22:58:53 +02:00
|
|
|
const SOCKET_OPTIONS = {
|
|
|
|
forceNew: true,
|
|
|
|
};
|
|
|
|
|
|
|
|
const room = 'test';
|
|
|
|
|
2020-04-05 14:20:00 +02:00
|
|
|
function App() {
|
|
|
|
return (
|
2020-06-05 22:58:53 +02:00
|
|
|
<RecoilRoot>
|
|
|
|
<Provider url={SOCKET_URL} options={SOCKET_OPTIONS}>
|
|
|
|
<C2CProvider room={room}>
|
|
|
|
<div className='App'>
|
2020-06-07 13:49:04 +02:00
|
|
|
<BoardView room={room} />
|
2020-06-05 22:58:53 +02:00
|
|
|
</div>
|
|
|
|
</C2CProvider>
|
|
|
|
</Provider>
|
|
|
|
</RecoilRoot>
|
2020-04-05 14:20:00 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|