Exemple #1
0
export default connect( ( state ) => ( {
	sectionName: getSectionName( state ),
	isSectionLoading: isSectionLoading( state ),
	tourState: getGuidedTourState( state ),
	isValid: ( when ) => !! when( state ),
	lastAction: getLastAction( state ),
} ), {
Exemple #2
0
export function shouldViewBeVisible( state ) {
	const sectionName = getSectionName( state );

	return isEnabled( 'ui/first-view' ) &&
		isViewEnabled( state, sectionName ) &&
		! wasFirstViewHiddenSinceEnteringCurrentSection( state ) &&
		! isSectionLoading( state );
}
Exemple #3
0
	state => ( {
		sectionName: getSectionName( state ),
		isSectionLoading: isSectionLoading( state ),
		tourState: getGuidedTourState( state ),
		isValid: when => !! when( state ),
		lastAction: getLastAction( state ),
		requestedTour: getInitialQueryArguments( state ).tour,
	} ),
Exemple #4
0
export function shouldViewBeVisible( state ) {
	const firstViewConfig = getConfigForCurrentView( state );

	if ( ! firstViewConfig ) {
		return false;
	}

	return isViewEnabled( state, firstViewConfig ) &&
		! wasFirstViewHiddenSinceEnteringCurrentSection( state, firstViewConfig ) &&
		! isSectionLoading( state );
}
Exemple #5
0
	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,
		} );
	},
Exemple #6
0
	state => [
		getRawGuidedTourState( state ),
		isSectionLoading( state ),
		getSelectedSite( state ),
	]