Skip to content

Commit

Permalink
Switch to search on tour restart
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhxNguyen7 committed Jan 26, 2024
1 parent 70aa35d commit 491c612
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/antalmanac/src/components/Tutorial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ import { useTour } from '@reactour/tour';

import { useEffect, useMemo } from 'react';
import { stepsFactory, tourShouldRun } from '$lib/TutorialHelpers';
import useCoursePaneStore from '$stores/CoursePaneStore';

export function Tutorial() {
const { setCurrentStep, setIsOpen, setSteps } = useTour();
const [displaySearch, disableManualSearch] = useCoursePaneStore((state) => [
state.displaySearch,
state.disableManualSearch,
]);

const restartTour = useMemo(
() => () => {
displaySearch();
disableManualSearch();
setCurrentStep(0);
setIsOpen(true);
},
Expand Down

0 comments on commit 491c612

Please sign in to comment.