import React from 'react'; import { Button } from 'UI' import { useStore } from 'App/mstore'; import { observer } from 'mobx-react-lite'; import { RADIUS } from '../utils'; import SectionTitle from './SectionTitle'; import XRay from './StepsComponents/XRay'; import StepRenderer from './StepsComponents/StepRenderer'; import StepRadius from './StepsComponents/StepRadius'; import SubModal from './StepsComponents/SubModal'; import { Note } from 'App/services/NotesService'; interface Props { xrayProps: { currentLocation: Record[]; resourceList: Record[]; exceptionsList: Record[]; eventsList: Record[]; endTime: number; }; notes: Note[]; members: Record[]; } function Steps({ xrayProps, notes, members }: Props) { const { bugReportStore } = useStore(); const [stepPickRadius, setRadius] = React.useState(RADIUS); const [timePointer, setPointer] = React.useState(0); const shouldShowEventReset = bugReportStore.chosenEventSteps.length > 0; const handleStepsSelection = () => { if (shouldShowEventReset) { return clearEventSelection(); } if (timePointer > 0) { // temp ? return bugReportStore.setSteps(bugReportStore.sessionEventSteps); } else { bugReportStore.setSteps(bugReportStore.sessionEventSteps); } }; const clearEventSelection = () => { setPointer(0); bugReportStore.resetSteps(); }; React.useEffect(() => { if (bugReportStore.sessionEventSteps.length < RADIUS && bugReportStore.sessionEventSteps.length > 0) { setRadius(bugReportStore.sessionEventSteps.length); } }, [bugReportStore.sessionEventSteps]) return (
Steps to reproduce
STEPS
{timePointer > 0 ? ( ) : null}
{bugReportStore.isSubStepModalOpen ? ( ) : null}
); } export default observer(Steps);