feat: add blur only one page

This commit is contained in:
yury 2024-06-22 10:58:33 +03:00
parent 175f75f068
commit 53ea9ae8e0

View File

@ -3,7 +3,7 @@ import styles from "./styles.module.scss";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import { actions, selectors } from "@/store"; import { actions, selectors } from "@/store";
import { useNavigate } from "react-router-dom"; import {useNavigate, useLocation} from "react-router-dom";
import routes from "@/routes"; import routes from "@/routes";
import Answer from "../../../../ui/Answer"; import Answer from "../../../../ui/Answer";
import QuestionnaireGreenButton from "../../../../ui/GreenButton"; import QuestionnaireGreenButton from "../../../../ui/GreenButton";
@ -19,6 +19,7 @@ function MultiplyAnswers({ answers }: IMultiplyAnswersProps) {
const { currentlyAffecting, gender } = useSelector( const { currentlyAffecting, gender } = useSelector(
selectors.selectQuestionnaire selectors.selectQuestionnaire
); );
const location = useLocation();
const handleClick = (answer: IAnswer) => { const handleClick = (answer: IAnswer) => {
if (currentlyAffecting.includes(`$${answer.id}`)) { if (currentlyAffecting.includes(`$${answer.id}`)) {
@ -54,6 +55,7 @@ function MultiplyAnswers({ answers }: IMultiplyAnswersProps) {
); );
}; };
return ( return (
<> <>
<div className={styles["multiply-answers"]}> <div className={styles["multiply-answers"]}>
@ -79,7 +81,7 @@ function MultiplyAnswers({ answers }: IMultiplyAnswersProps) {
</div> </div>
{!!currentlyAffecting.length && ( {!!currentlyAffecting.length && (
<QuestionnaireGreenButton <QuestionnaireGreenButton
isActiveBlur={true} isActiveBlur={location.pathname.includes('v1/questionnaire/relationships/currentlyAffecting/')}
className={styles.button} className={styles.button}
onClick={handleNext} onClick={handleNext}
> >