diff --git a/cryptide_project/src/App.tsx b/cryptide_project/src/App.tsx index 40cf7ee..9cdc801 100644 --- a/cryptide_project/src/App.tsx +++ b/cryptide_project/src/App.tsx @@ -45,6 +45,7 @@ import messagesEn from './Translations/en.json'; import ErrorBoundary from './Error/ErrorBoundary'; import ErrorPage from './Error/ErrorPage'; import NewPlay from './Pages/NewPlay'; +import DeducCheck from './Pages/DeducCheck'; const messages = { fr: messagesFr, @@ -85,7 +86,8 @@ function App() { } /> }/> } /> - } /> + } /> + } /> } /> }/> {/* }/> */} diff --git a/cryptide_project/src/Pages/DeducCheck.tsx b/cryptide_project/src/Pages/DeducCheck.tsx new file mode 100644 index 0000000..646d77b --- /dev/null +++ b/cryptide_project/src/Pages/DeducCheck.tsx @@ -0,0 +1,107 @@ +import React from 'react'; + +/* Style */ +import './DeducGrid.css'; +import { useTheme } from '../Style/ThemeContext'; + +/* Component */ + +/* Boostrap */ +import Table from 'react-bootstrap/Table'; +import Form from 'react-bootstrap/Form'; + +/* lang */ +import { FormattedMessage } from 'react-intl'; + +/* model */ +import Stub from '../model/Stub'; + +import { useGame } from '../Contexts/GameContext'; + +function DeducCheck() { + const theme = useTheme(); + //const indices = Stub.GenerateIndice(); + + + // const { players } = useGame(); + + const indices = Stub.GenerateIndice(); + + const halfLength = Math.ceil(indices.length / 2); + const firstHalfIndices = indices.slice(0, halfLength); + const secondHalfIndices = indices.slice(halfLength); + + const players = [ + "🔵", + "🟢", + "🟡", + "🟣", + "🔴"] + + // const players = [ + // "bla", + // "bli", + // "blou", + // "blu", + // "ble", + // ] + + console.log(players) + return ( +
+
+ {/* Premier tableau */} + + + + + {players.map((player, index) => ( + + ))} + + + + {firstHalfIndices.map((indice, rowIndex) => ( + + + {players.map((player, colIndex) => ( + + ))} + + ))} + +
Indices{player}
{indice.ToString("fr")} + {/* */} + +
+ + {/* Deuxième tableau */} + + + + + {players.map((player, index) => ( + + ))} + + + + {secondHalfIndices.map((indice, rowIndex) => ( + + + {players.map((player, colIndex) => ( + + ))} + + ))} + +
Indices{player}
{indice.ToString("fr")} + {/* */} + +
+
+
+ ); +} + +export default DeducCheck;