export default connect( ( state ) => ( { sectionName: getSectionName( state ), isSectionLoading: isSectionLoading( state ), tourState: getGuidedTourState( state ), isValid: ( when ) => !! when( state ), lastAction: getLastAction( state ), } ), {
export function shouldViewBeVisible( state ) { const sectionName = getSectionName( state ); return isEnabled( 'ui/first-view' ) && isViewEnabled( state, sectionName ) && ! wasFirstViewHiddenSinceEnteringCurrentSection( state ) && ! isSectionLoading( state ); }
state => ( { sectionName: getSectionName( state ), isSectionLoading: isSectionLoading( state ), tourState: getGuidedTourState( state ), isValid: when => !! when( state ), lastAction: getLastAction( state ), requestedTour: getInitialQueryArguments( state ).tour, } ),
export function shouldViewBeVisible( state ) { const firstViewConfig = getConfigForCurrentView( state ); if ( ! firstViewConfig ) { return false; } return isViewEnabled( state, firstViewConfig ) && ! wasFirstViewHiddenSinceEnteringCurrentSection( state, firstViewConfig ) && ! isSectionLoading( state ); }
state => { const tourState = getRawGuidedTourState( state ); const site = getSelectedSite( state ); const { shouldReallyShow, stepName = '' } = tourState; const stepConfig = getToursConfig( site )[ stepName ] || false; const nextStepConfig = getToursConfig( site )[ stepConfig.next ] || false; const shouldShow = !! ( ! isSectionLoading( state ) && shouldReallyShow ); return Object.assign( {}, tourState, { stepConfig, nextStepConfig, shouldShow, } ); },
state => [ getRawGuidedTourState( state ), isSectionLoading( state ), getSelectedSite( state ), ]