1
1
import { atom , useAtom } from "jotai" ;
2
2
import { atomWithStorage } from "jotai/utils" ;
3
- import type { Step } from "react-joyride" ;
3
+ import { useEffect } from "react" ;
4
+ import type { CallBackProps , Step } from "react-joyride" ;
4
5
5
6
export const TourStepTargets = {
6
7
One : "tour-step-1" ,
@@ -10,6 +11,7 @@ export const TourStepTargets = {
10
11
export const tourSteps = (
11
12
[
12
13
{
14
+ disableBeacon : true ,
13
15
target : TourStepTargets . One ,
14
16
content :
15
17
"Welcome to Ryot! Let's get started by adding a movie to your watchlist. Click on the media section in the sidebar to see what all you can track." ,
@@ -24,11 +26,19 @@ export const tourSteps = (
24
26
25
27
const onboardingTourAtom = atom < { currentStepIndex : number } | undefined > ( ) ;
26
28
29
+ export const handleJoyrideCallback = ( data : CallBackProps ) => {
30
+ console . log ( data ) ;
31
+ } ;
32
+
27
33
export const useOnboardingTour = ( ) => {
28
34
const [ tourState , setTourState ] = useAtom ( onboardingTourAtom ) ;
29
35
30
- const startTour = ( ) => setTourState ( { currentStepIndex : 0 } ) ;
31
36
const stopTour = ( ) => setTourState ( undefined ) ;
37
+ const startTour = ( ) => setTourState ( { currentStepIndex : 0 } ) ;
38
+
39
+ useEffect ( ( ) => {
40
+ console . log ( new Date ( ) . toISOString ( ) ) ;
41
+ } , [ ] ) ;
32
42
33
43
return {
34
44
stopTour,
@@ -46,7 +56,7 @@ type OpenedSidebarLinks = {
46
56
} ;
47
57
48
58
const openedSidebarLinksAtom = atomWithStorage < OpenedSidebarLinks > (
49
- "openedSidebarLinks " ,
59
+ "OpenedSidebarLinks " ,
50
60
{
51
61
media : false ,
52
62
fitness : false ,
0 commit comments