diff --git a/src/app/components/OnboardingButton.tsx b/src/app/components/OnboardingButton.tsx index fdfcc22b..20ba9635 100644 --- a/src/app/components/OnboardingButton.tsx +++ b/src/app/components/OnboardingButton.tsx @@ -1,19 +1,16 @@ import { Button, Tooltip } from "antd"; import { BookOpen } from "phosphor-react"; -import React from "react"; -import { useSelector } from "react-redux"; -import { RootState } from "../store/store"; -import { BackendStatus } from "../types/mainSlice.types"; +import React, { useContext } from "react"; import { useOnBoardingRef } from "../../features/onboarding/utils/useOnboardingRef"; import { OnbrdStep } from "../../features/onboarding/types/constants"; import { OnboardingPopup } from "../../features/onboarding/components/OnboardingPopup"; import { componentsTexts } from "../utils/constants"; +import { OnboardingContext } from "../../features/onboarding/OnboardingProvider"; export const OnboardingButton = () => { const [isTooltipVisible, setIsTooltipVisible] = React.useState(false); - const isOnboardingAvailable = - useSelector((_state) => _state.main.backendAvailable) === BackendStatus.Accessed; + const { isOnboardingAvailable } = useContext(OnboardingContext); const onbrdRef = useOnBoardingRef(OnbrdStep.Onboarding); diff --git a/src/app/components/ReportProblem.tsx b/src/app/components/ReportProblem.tsx index eed278ec..5695b2a2 100644 --- a/src/app/components/ReportProblem.tsx +++ b/src/app/components/ReportProblem.tsx @@ -3,7 +3,7 @@ import TextArea from "antd/lib/input/TextArea"; import { UploadChangeParam } from "antd/lib/upload"; import { RcFile, UploadFileStatus } from "antd/lib/upload/interface"; import { UploadSimple, Warning } from "phosphor-react"; -import React, { useEffect, useState } from "react"; +import React, { useContext, useEffect, useState } from "react"; import { useSelector } from "react-redux"; import { selectCurrentPage } from "../main.selectors"; import { PageType } from "../types/mainSlice.types"; @@ -20,6 +20,7 @@ import { import { selectCurrentPageObject } from "../../features/pageObjects/selectors/pageObjects.selectors"; import { useOnBoardingRef } from "../../features/onboarding/utils/useOnboardingRef"; import { OnbrdStep } from "../../features/onboarding/types/constants"; +import { OnboardingContext } from "../../features/onboarding/OnboardingProvider"; const { info } = Modal; @@ -61,6 +62,8 @@ export const ReportProblem = () => { if (files) files.scrollTop = files.scrollHeight; }, [fileList]); + const { isOpen: isOnboardingOpen } = useContext(OnboardingContext); + const showExceptionConfirm = () => info({ title: "Problem report", @@ -176,6 +179,7 @@ export const ReportProblem = () => {