Skip to content

Commit

Permalink
typescript ok, refacto ok
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-pages committed Sep 26, 2024
1 parent 3cd850e commit 177af22
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
3 changes: 1 addition & 2 deletions src/api/game/game.getOneGameById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useQuery } from 'react-query';

import { serializeToQueryUrl } from 'src/utils';
import { axiosRequest } from 'src/utils/axiosRequest';
// import { GameType } from 'types/game.type';

type Input = {
selectedValue: string;
Expand Down Expand Up @@ -37,7 +36,7 @@ type GetOneGameByIdProps = {
subType: number;
id: number;
};
// TODO : remove specific mimic management after mimic is standard

export async function getOneGameById({ subType, id }: GetOneGameByIdProps) {
const path = `/standardGame/${id}${serializeToQueryUrl({
subType,
Expand Down
19 changes: 0 additions & 19 deletions src/components/game/DisplayGameById.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ const DisplayGameById = ({ subType }: SubTypeProps) => {
};

const getNextGame = useCallback(async () => {
// [1] Reset game.
setFound(false);
setGameResponses([]);
setTryCount(0);
Expand Down Expand Up @@ -257,7 +256,6 @@ const DisplayGameById = ({ subType }: SubTypeProps) => {
inputs.map((input) => {
if (input.response || input.response === false) {
if (getOneGameById.subType === GameType.MONEY) {
// Utilisation des templates de chaînes de caractères
const significationWithEuro = `${input.selectedValue} ${euro}`;
responses.push({ isSuccess: input.response, signification: significationWithEuro, value: input.response ? 0 : fakeSignificationIndex });
} else {
Expand Down Expand Up @@ -376,21 +374,6 @@ const DisplayGameById = ({ subType }: SubTypeProps) => {
)}
</div>
</div>
<Grid container spacing={1} style={{ flex: 1, justifyContent: 'space-around' }}>
{/* <RadioGroup row defaultValue={RadioBoxValues.NEW}>
{Object.keys(radioListComponentMapper).map((value: string, index: number) => {
return (
<RadioNextGame
key={index}
value={value as RadioBoxValues}
Icon={radioListComponentMapper[value as RadioBoxValues]}
onChange={handleRadioButtonChange}
checked={selectedValue === value}
/>
);
})}
</RadioGroup> */}
</Grid>
<Grid
container
border={1}
Expand Down Expand Up @@ -446,7 +429,6 @@ const DisplayGameById = ({ subType }: SubTypeProps) => {
signification={signification}
disabled={isDisabled}
isCorrect={isCorrect || (tryCount > 1 && isSuccess)}
// mimicOrigine={mimicOrigine}
/>
</div>
);
Expand Down Expand Up @@ -520,7 +502,6 @@ const DisplayGameById = ({ subType }: SubTypeProps) => {
</Grid>
<Grid item xs={3} display="flex" justifyContent="flex-end">
<Button variant="outlined" color="primary" onClick={getNextGame}>
{/* <Button variant="outlined" color="primary"> */}
Jeu suivant
</Button>
</Grid>
Expand Down

0 comments on commit 177af22

Please sign in to comment.