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';
|
|
|
|
import Board from './views/Board';
|
|
|
|
import { C2CProvider } from './hooks/useC2C';
|
|
|
|
|
|
|
|
import { RecoilRoot } from 'recoil';
|
|
|
|
|
|
|
|
const SOCKET_URL = process.env.REACT_APP_SOCKET_URL || 'http://localhost:4000';
|
|
|
|
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'>
|
|
|
|
<Board room={room} />
|
|
|
|
</div>
|
|
|
|
</C2CProvider>
|
|
|
|
</Provider>
|
|
|
|
</RecoilRoot>
|
2020-04-05 14:20:00 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|