Skip to content

Commit

Permalink
Working tour start. Committing before I break it
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Jul 19, 2018
1 parent 93d50fd commit d9a91cc
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions client/layout/guided-tours/tours/jetpack-plugin-updates-tour.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/** @format */

/**
* External dependencies
*/
import React, { Fragment } from 'react';
import Gridicon from 'gridicons';
import React, { Fragment } from 'react';

/**
* Internal dependencies
*/
import PluginsStore from 'lib/plugins/store';
import { getSelectedSite } from 'state/ui/selectors';
import {
ButtonRow,
Continue,
Expand All @@ -18,32 +19,18 @@ import {
Step,
Tour,
} from 'layout/guided-tours/config-elements';
import PluginsStore from 'lib/plugins/store';
import { getSelectedSite } from 'state/ui/selectors';
import { query } from 'layout/guided-tours/positioning';

window.pstore = PluginsStore;

export const JetpackPluginUpdatesTour = makeTour(
<Tour
name="jetpackPluginUpdates"
version="20180611"
when={ state => PluginsStore.getSitePlugin( getSelectedSite( state ), 'jetpack' ) }
>
<Tour name="jetpackPluginUpdates" version="20180611">
<Step
name="init"
wait={ () => !! query( '.plugin-item-jetpack .form-toggle:enabled' ).length }
when={ state => {
const site = getSelectedSite( state );
const res =
! PluginsStore.isFetchingSite( site ) && !! PluginsStore.getSitePlugin( site, 'jetpack' );
return res;
} }
target=".plugin-item-jetpack .form-toggle__switch"
onTargetDisappear={
/**
* noop
*
* Wait doesn't _wait_ for it's condition before calling this.
* This will therefore be called _before_ we've shown the tour.
* We don't want to quit in those cases :/
*/
() => {}
}
arrow="top-left"
placement="below"
style={ {
Expand Down

0 comments on commit d9a91cc

Please sign in to comment.