From 2ce4cc496d74b1e7c836ae250e402ebc38ef695e Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Fri, 20 Oct 2023 13:43:55 +0300 Subject: [PATCH] CLick on advisories title --- .../ValidatorOnboarding/Advisories/Advisories.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pages/ValidatorOnboarding/Advisories/Advisories.tsx b/src/pages/ValidatorOnboarding/Advisories/Advisories.tsx index c92ce906..854e77e1 100644 --- a/src/pages/ValidatorOnboarding/Advisories/Advisories.tsx +++ b/src/pages/ValidatorOnboarding/Advisories/Advisories.tsx @@ -12,13 +12,17 @@ type AdvisoryTopicsType = { const Advisories = () => { const { subStepAdvisories } = useSelector((state: RootState) => state.advisories) + const [selectedTitle, setSelectedTitle] = useState(Object.keys(advisoryTopics)[0]) const unicodeNumbers = ['➀', '➁', '➂', '➃', '➄', '➅'] - const advisoriesIcons = unicodeNumbers.map((number, index) => - index <= subStepAdvisories ? '✓' : number, - ) + const advisoriesIcons = unicodeNumbers.map((number, index) => { + if (selectedTitle === Object.keys(advisoryTopics)[index]) { + return '✓' + } else { + return index <= subStepAdvisories ? '✓' : number + } + }) - const [selectedTitle, setSelectedTitle] = useState(Object.keys(advisoryTopics)[0]) useEffect(() => { setSelectedTitle(Object.keys(advisoryTopics)[subStepAdvisories]) }, [subStepAdvisories]) @@ -58,7 +62,7 @@ const Advisories = () => { {title}