File tree Expand file tree Collapse file tree
src/components/VisualTour Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ export interface VisualTourProps {
3535 prevLabel ?: string ;
3636 /** The step target is usable, e.g. it can be clicked. */
3737 usableStepTarget ?: boolean ;
38- /** If the component is included then it starts. You can prevent this behaviour by setting this property to `false` . */
39- dontStartAutomatically ?: boolean ;
38+ /** Need to be set to `true` that the tour is displayed . */
39+ isOpen ?: boolean ;
4040}
4141
4242export interface VisualTourStep {
@@ -69,9 +69,9 @@ export const VisualTour = ({
6969 nextLabel = "Next" ,
7070 prevLabel = "Back" ,
7171 usableStepTarget = false ,
72- dontStartAutomatically = false ,
72+ isOpen = false ,
7373} : VisualTourProps ) => {
74- if ( dontStartAutomatically ) {
74+ if ( isOpen === false ) {
7575 return null ;
7676 }
7777
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ const Template: StoryFn<typeof VisualTour> = (args: VisualTourProps) => {
5050 < VisualTour
5151 { ...args }
5252 onClose = { ( ) => setIsOpen ( false ) }
53- dontStartAutomatically = { typeof isOpen !== "undefined" ? ! isOpen : args . dontStartAutomatically }
53+ isOpen = { typeof isOpen !== "undefined" ? isOpen : args . isOpen }
5454 />
5555 </ div >
5656 ) ;
@@ -107,6 +107,6 @@ const defaultArgs: VisualTourProps = {
107107 } ,
108108 ] ,
109109 onClose : ( ) => { } ,
110- dontStartAutomatically : true ,
110+ isOpen : false ,
111111} ;
112112Default . args = defaultArgs ;
You can’t perform that action at this time.
0 commit comments