chg: dev: massive refactor on front-end - and remove unnecessary deps #4
This commit is contained in:
26
assets/js/mine-seeker/MineSeeker.jsx
Normal file
26
assets/js/mine-seeker/MineSeeker.jsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import React, { useRef } from 'react';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { GameProvider } from './contexts/GameContext';
|
||||
import { GameBoard } from './components/GameBoard';
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
const MineSeeker = ({ env, gameId }) => {
|
||||
const isEnvDev = 'dev' === env;
|
||||
const gameAssoc = useRef('' !== gameId ? gameId : crypto.randomUUID()).current;
|
||||
const gameInherited = '' !== gameId;
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<GameProvider>
|
||||
<GameBoard
|
||||
gameAssoc={gameAssoc}
|
||||
gameInherited={gameInherited}
|
||||
isEnvDev={isEnvDev}
|
||||
/>
|
||||
</GameProvider>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export default MineSeeker;
|
||||
Reference in New Issue
Block a user