From 97201db51b3d0fcef473a626b2beb030d9a47294 Mon Sep 17 00:00:00 2001
From: Bastien DUMONT <bdumont@grandlyon.com>
Date: Mon, 10 Jul 2023 14:05:55 +0000
Subject: [PATCH] fix(astuces): back mobile

---
 src/components/Ecogesture/SingleEcogesture.tsx           | 9 ++-------
 .../__snapshots__/SingleEcogesture.spec.tsx.snap         | 1 -
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/components/Ecogesture/SingleEcogesture.tsx b/src/components/Ecogesture/SingleEcogesture.tsx
index 93a6a28f8..385db2a33 100644
--- a/src/components/Ecogesture/SingleEcogesture.tsx
+++ b/src/components/Ecogesture/SingleEcogesture.tsx
@@ -17,7 +17,7 @@ import { useI18n } from 'cozy-ui/transpiled/react/I18n'
 import Icon from 'cozy-ui/transpiled/react/Icon'
 import { Ecogesture } from 'models'
 import React, { useCallback, useEffect, useMemo, useState } from 'react'
-import { Location, useLocation, useNavigate, useParams } from 'react-router-dom'
+import { Location, useLocation, useParams } from 'react-router-dom'
 import EcogestureService from 'services/ecogesture.service'
 import { useAppSelector } from 'store/hooks'
 import { importIconById } from 'utils/utils'
@@ -33,7 +33,6 @@ interface EcogestureLocation extends Location {
 const SingleEcogesture = () => {
   const { t } = useI18n()
   const client = useClient()
-  const navigate = useNavigate()
   const location: EcogestureLocation = useLocation()
   const [ecogesture, setEcogesture] = useState<Ecogesture>()
   const [ecogestureIcon, setEcogestureIcon] = useState<string>('')
@@ -122,11 +121,7 @@ const SingleEcogesture = () => {
   if (ecogesture) {
     return (
       <>
-        <CozyBar
-          titleKey={'common.title_ecogesture'}
-          displayBackArrow={true}
-          backFunction={() => navigate('/ecogestures')}
-        />
+        <CozyBar titleKey={'common.title_ecogesture'} displayBackArrow={true} />
         <Header
           setHeaderHeight={defineHeaderHeight}
           desktopTitleKey={'common.title_ecogesture'}
diff --git a/src/components/Ecogesture/__snapshots__/SingleEcogesture.spec.tsx.snap b/src/components/Ecogesture/__snapshots__/SingleEcogesture.spec.tsx.snap
index 2eb812c6f..031efb610 100644
--- a/src/components/Ecogesture/__snapshots__/SingleEcogesture.spec.tsx.snap
+++ b/src/components/Ecogesture/__snapshots__/SingleEcogesture.spec.tsx.snap
@@ -15,7 +15,6 @@ exports[`SingleEcogesture component should be rendered correctly 1`] = `
 >
   <SingleEcogesture>
     <Component
-      backFunction={[Function]}
       displayBackArrow={true}
       titleKey="common.title_ecogesture"
     >
-- 
GitLab