From 2a36746ef626d7ac3f1094d9f20038c823bd8a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Tue, 14 Mar 2023 18:51:10 +0100 Subject: [PATCH] =?UTF-8?q?Hide=20button=20"Quelle=20est=20votre=20activit?= =?UTF-8?q?=C3=A9=20=3F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recherche-code-ape/SearchCodeAPE.tsx | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/site/source/pages/assistants/recherche-code-ape/SearchCodeAPE.tsx b/site/source/pages/assistants/recherche-code-ape/SearchCodeAPE.tsx index 38fb555ea..f32ab6cf2 100644 --- a/site/source/pages/assistants/recherche-code-ape/SearchCodeAPE.tsx +++ b/site/source/pages/assistants/recherche-code-ape/SearchCodeAPE.tsx @@ -204,7 +204,7 @@ export default function SearchCodeAPE({ disabled }: SearchCodeApeProps) { )} - + ) @@ -217,27 +217,38 @@ const StyledRadioCardGroup = styled(RadioCardGroup)` flex-wrap: wrap; ` -const ActivityNotFound = () => { +const ActivityNotFound = ({ job }: { job: string }) => { + const [hide, setHide] = useState(false) const { t } = useTranslation() + useEffect(() => { + if (job.length > 0) { + setHide(true) + } + }, [job.length]) + return ( <> ( + trigger={(buttonProps) => // eslint-disable-next-line react/jsx-props-no-spreading - - )} + hide ? ( + + ) : ( + <> + ) + } small > {() => (