-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Guided Tours: Add Site Title tour (#8627)
* Initial implementation of Site Title tour * Lint fixes * wip: got it to "work" by removing a few things ... but it still only appears after a few seconds and / or a bit of scrolling and / or clicking around. * debug: are we "waiting" somewhere ...? * Update tour steps * fix last step * Implemented selectedSiteHasDefaultSiteTitle * copy tweaks * add user age selector * tour start conditions, add config option for site-title tour * Editorial copy changes * hotfix arrow for settings step * framework: fix positioning for xAboveBelow * add tagline step * make actionstep work with & without gridicon present * add userCanEditSettingsOfSelectedSite selector * add new condition for site title tour * use translated site title for comparsions * small css tweak * add a/b test for tour * remove specific styling and let framework handle it * remove dev debugging statements * removed extraneous selector for a/b * declare internal/external dependencies * copy updates * rewrite user age selectors * use better selector naming convention * fix for failing test * use /stats as a path * disable a/b test by default * only laod tour on desktop for now * sort imports * code style improvements * fixed indentation * add check for parsed date being valid * remove translate calls * add explanation to hasDefaultSiteTitle * use startsWith from lodash * make sure there's whitespace after the `strong` part in the last step * update a/b test date and tour version
- Loading branch information
1 parent
d629ffc
commit a3803e0
Showing
12 changed files
with
206 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
import { translate } from 'i18n-calypso'; | ||
import { overEvery as and } from 'lodash'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { | ||
ButtonRow, | ||
Continue, | ||
Link, | ||
makeTour, | ||
Next, | ||
Quit, | ||
Step, | ||
Tour, | ||
} from 'layout/guided-tours/config-elements'; | ||
import { | ||
hasSelectedSiteDefaultSiteTitle, | ||
isUserOlderThan, | ||
isEnabled, | ||
canUserEditSettingsOfSelectedSite, | ||
isAbTestInVariant, | ||
} from 'state/ui/guided-tours/contexts'; | ||
import Gridicon from 'components/gridicon'; | ||
import { isDesktop } from 'lib/viewport'; | ||
|
||
const TWO_DAYS_IN_MILLISECONDS = 2 * 1000 * 3600 * 24; | ||
|
||
export const SiteTitleTour = makeTour( | ||
<Tour | ||
name="siteTitle" | ||
version="20161207" | ||
path="/stats" | ||
when={ and( | ||
isEnabled( 'guided-tours/site-title' ), | ||
isDesktop, | ||
hasSelectedSiteDefaultSiteTitle, | ||
canUserEditSettingsOfSelectedSite, | ||
isUserOlderThan( TWO_DAYS_IN_MILLISECONDS ), | ||
isAbTestInVariant( 'siteTitleTour', 'enabled' ) | ||
) } | ||
> | ||
<Step name="init" placement="right" next="click-settings"> | ||
<p> | ||
Hey there! We noticed you haven't changed the title of your site yet. | ||
Want to change it? | ||
</p> | ||
<ButtonRow> | ||
<Next step="click-settings">Yes, please!</Next> | ||
<Quit>No thanks</Quit> | ||
</ButtonRow> | ||
</Step> | ||
|
||
<Step name="click-settings" | ||
target="settings" | ||
arrow="left-top" | ||
placement="beside" | ||
scrollContainer=".sidebar__region" | ||
shouldScrollTo | ||
> | ||
<Continue target="settings" step="site-title-input" click> | ||
Click <strong><Gridicon icon="cog" size={ 24 } /> Settings</strong> to continue. | ||
</Continue> | ||
</Step> | ||
|
||
<Step name="site-title-input" | ||
target="site-title-input" | ||
arrow="top-left" | ||
placement="below" | ||
> | ||
<p> | ||
You can change the site title here. The site title appears in places | ||
like the top of your web browser and in search results. | ||
</p> | ||
<ButtonRow> | ||
<Next step="site-tagline-input">Looks Good!</Next> | ||
<Quit>Cancel</Quit> | ||
</ButtonRow> | ||
</Step> | ||
|
||
<Step name="site-tagline-input" | ||
target="site-tagline-input" | ||
arrow="top-left" | ||
placement="below" | ||
> | ||
<p> | ||
This is the tagline of your site. It should explain what your site | ||
is about in few words. It usually appears right bellow your site title. | ||
</p> | ||
<ButtonRow> | ||
<Next step="click-save">Great!</Next> | ||
<Quit>Cancel</Quit> | ||
</ButtonRow> | ||
</Step> | ||
|
||
<Step name="click-save" | ||
target="settings-site-profile-save" | ||
arrow="top-right" | ||
placement="below" | ||
> | ||
<Continue target="settings-site-profile-save" step="finish" click> | ||
Don't forget to save your changes. | ||
</Continue> | ||
</Step> | ||
|
||
<Step name="finish" placement="center"> | ||
<p> | ||
<strong>That's it!</strong> Your visitors can now easily identify your website by its title. | ||
</p> | ||
<ButtonRow> | ||
<Quit primary>{ translate( "We're all done!" ) }</Quit> | ||
</ButtonRow> | ||
<Link href="https://learn.wordpress.com"> | ||
{ translate( 'Learn more about WordPress.com' ) } | ||
</Link> | ||
</Step> | ||
</Tour> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters