From b6f37d00aef00346346745ea64102ff86cd3ff6e Mon Sep 17 00:00:00 2001
From: Bastien Dumont <bdumont@grandlyon.com>
Date: Tue, 10 Oct 2023 10:40:03 +0200
Subject: [PATCH] chore: remove explicit type Client

---
 src/components/Action/ActionBegin/ActionBegin.tsx         | 4 ++--
 src/components/Action/ActionList/ActionList.tsx           | 4 ++--
 src/components/Quiz/QuizBegin/QuizBegin.tsx               | 4 ++--
 src/components/Quiz/QuizQuestion/QuizQuestion.tsx         | 8 ++++----
 src/components/Quiz/QuizQuestion/QuizQuestionContent.tsx  | 4 ++--
 .../Quiz/QuizQuestion/QuizQuestionContentCustom.tsx       | 4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/components/Action/ActionBegin/ActionBegin.tsx b/src/components/Action/ActionBegin/ActionBegin.tsx
index c2a39a4a7..8394e1796 100644
--- a/src/components/Action/ActionBegin/ActionBegin.tsx
+++ b/src/components/Action/ActionBegin/ActionBegin.tsx
@@ -3,7 +3,7 @@ import defaultIcon from 'assets/icons/visu/ecogesture/default.svg'
 import ActionModal from 'components/Action/ActionModal/ActionModal'
 import StyledIcon from 'components/CommonKit/Icon/StyledIcon'
 import StarsContainer from 'components/CommonKit/StarsContainer/StarsContainer'
-import { Client, useClient } from 'cozy-client'
+import { useClient } from 'cozy-client'
 import { useI18n } from 'cozy-ui/transpiled/react/I18n'
 import { Ecogesture, UserChallenge } from 'models'
 import React, { useCallback, useEffect, useState } from 'react'
@@ -23,8 +23,8 @@ const ActionBegin = ({
   setShowList,
   userChallenge,
 }: ActionBeginProps) => {
-  const client: Client = useClient()
   const { t } = useI18n()
+  const client = useClient()
   const {
     global: { fluidTypes },
     profile: { isProfileTypeCompleted },
diff --git a/src/components/Action/ActionList/ActionList.tsx b/src/components/Action/ActionList/ActionList.tsx
index a9ff78bb1..b79e28bc2 100644
--- a/src/components/Action/ActionList/ActionList.tsx
+++ b/src/components/Action/ActionList/ActionList.tsx
@@ -1,5 +1,5 @@
 import ActionCard from 'components/Action/ActionCard/ActionCard'
-import { Client, useClient } from 'cozy-client'
+import { useClient } from 'cozy-client'
 import { Ecogesture } from 'models'
 import React, { useEffect, useState } from 'react'
 import ActionService from 'services/action.service'
@@ -12,7 +12,7 @@ interface ActionListProps {
 }
 
 const ActionList = ({ setSelectedAction, setShowList }: ActionListProps) => {
-  const client: Client = useClient()
+  const client = useClient()
   const {
     global: { fluidTypes },
     profile: { isProfileTypeCompleted },
diff --git a/src/components/Quiz/QuizBegin/QuizBegin.tsx b/src/components/Quiz/QuizBegin/QuizBegin.tsx
index ee0a1bf83..55b3b01a2 100644
--- a/src/components/Quiz/QuizBegin/QuizBegin.tsx
+++ b/src/components/Quiz/QuizBegin/QuizBegin.tsx
@@ -2,7 +2,7 @@ import Button from '@material-ui/core/Button'
 import quizIcon from 'assets/icons/visu/quiz/questionMark.svg'
 import StyledIcon from 'components/CommonKit/Icon/StyledIcon'
 import StarsContainer from 'components/CommonKit/StarsContainer/StarsContainer'
-import { Client, useClient } from 'cozy-client'
+import { useClient } from 'cozy-client'
 import { useI18n } from 'cozy-ui/transpiled/react/I18n'
 import { UserChallengeUpdateFlag } from 'enums'
 import { UserChallenge } from 'models'
@@ -13,8 +13,8 @@ import { useAppDispatch } from 'store/hooks'
 import './quizBegin.scss'
 
 const QuizBegin = ({ userChallenge }: { userChallenge: UserChallenge }) => {
-  const client: Client = useClient()
   const { t } = useI18n()
+  const client = useClient()
   const dispatch = useAppDispatch()
   const launchQuiz = async () => {
     const challengeService: ChallengeService = new ChallengeService(client)
diff --git a/src/components/Quiz/QuizQuestion/QuizQuestion.tsx b/src/components/Quiz/QuizQuestion/QuizQuestion.tsx
index f8f13cc72..25ff5662b 100644
--- a/src/components/Quiz/QuizQuestion/QuizQuestion.tsx
+++ b/src/components/Quiz/QuizQuestion/QuizQuestion.tsx
@@ -1,4 +1,4 @@
-import { Client, useClient } from 'cozy-client'
+import { useClient } from 'cozy-client'
 import { QuestionEntity, UserChallenge } from 'models'
 import React, { useEffect, useState } from 'react'
 import { useNavigate } from 'react-router-dom'
@@ -9,6 +9,9 @@ import QuizQuestionContentCustom from './QuizQuestionContentCustom'
 import './quizQuestion.scss'
 
 const QuizQuestion = ({ userChallenge }: { userChallenge: UserChallenge }) => {
+  const client = useClient()
+  const { fluidTypes } = useAppSelector(state => state.ecolyo.global)
+  const navigate = useNavigate()
   const questionsIsLocked: boolean = userChallenge.quiz.questions.some(
     answer => answer.result == 0
   )
@@ -18,9 +21,6 @@ const QuizQuestion = ({ userChallenge }: { userChallenge: UserChallenge }) => {
   )
   const [customQuestionLoading, setCustomQuestionLoading] =
     useState<boolean>(false)
-  const client: Client = useClient()
-  const { fluidTypes } = useAppSelector(state => state.ecolyo.global)
-  const navigate = useNavigate()
 
   const goBack = () => {
     navigate('/challenges')
diff --git a/src/components/Quiz/QuizQuestion/QuizQuestionContent.tsx b/src/components/Quiz/QuizQuestion/QuizQuestionContent.tsx
index d26f33bdf..e96369c03 100644
--- a/src/components/Quiz/QuizQuestion/QuizQuestionContent.tsx
+++ b/src/components/Quiz/QuizQuestion/QuizQuestionContent.tsx
@@ -2,7 +2,7 @@ import Button from '@material-ui/core/Button'
 import CloseIcon from 'assets/icons/ico/close.svg'
 import StyledIconButton from 'components/CommonKit/IconButton/StyledIconButton'
 import QuizExplanationModal from 'components/Quiz/QuizExplanationModal/QuizExplanationModal'
-import { Client, useClient } from 'cozy-client'
+import { useClient } from 'cozy-client'
 import { useI18n } from 'cozy-ui/transpiled/react/I18n'
 import { UserChallengeUpdateFlag } from 'enums'
 import { Answer, UserChallenge, UserQuiz } from 'models'
@@ -25,7 +25,7 @@ const QuizQuestionContent = ({
   goBack,
 }: QuizQuestionContent) => {
   const { t } = useI18n()
-  const client: Client = useClient()
+  const client = useClient()
   const dispatch = useAppDispatch()
   const questionIndexLocked = userChallenge.quiz.questions.findIndex(
     answer => answer.result == 0
diff --git a/src/components/Quiz/QuizQuestion/QuizQuestionContentCustom.tsx b/src/components/Quiz/QuizQuestion/QuizQuestionContentCustom.tsx
index dc55ae0a7..88a344850 100644
--- a/src/components/Quiz/QuizQuestion/QuizQuestionContentCustom.tsx
+++ b/src/components/Quiz/QuizQuestion/QuizQuestionContentCustom.tsx
@@ -3,7 +3,7 @@ import CloseIcon from 'assets/icons/ico/close.svg'
 import StyledIconButton from 'components/CommonKit/IconButton/StyledIconButton'
 import Loader from 'components/Loader/Loader'
 import QuizExplanationModal from 'components/Quiz/QuizExplanationModal/QuizExplanationModal'
-import { Client, useClient } from 'cozy-client'
+import { useClient } from 'cozy-client'
 import { useI18n } from 'cozy-ui/transpiled/react/I18n'
 import { UsageEventType, UserChallengeUpdateFlag } from 'enums'
 import { Answer, QuestionEntity, UserChallenge, UserQuiz } from 'models'
@@ -29,7 +29,7 @@ const QuizQuestionContentCustom = ({
   isLoading,
 }: QuizQuestionContentCustomProps) => {
   const { t } = useI18n()
-  const client: Client = useClient()
+  const client = useClient()
   const dispatch = useAppDispatch()
 
   const [userChoice, setUserChoice] = useState<string>('')
-- 
GitLab