Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a link to Theme Setup in the theme activation Thanks Modal.
  • Loading branch information
kwight committed Jan 16, 2017
1 parent 4076b2d commit f1b085d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/my-sites/themes/style.scss
@@ -1,7 +1,7 @@
.themes-thanks-modal {
width: 300px;
padding: 1.5em;
min-height: 245px;
min-height: 285px;

@include breakpoint( "<480px" ) {
box-sizing: border-box;
Expand Down
11 changes: 11 additions & 0 deletions client/my-sites/themes/thanks-modal.jsx
Expand Up @@ -19,6 +19,7 @@ import {
getThemeDetailsUrl,
getThemeCustomizeUrl,
getThemeForumUrl,
getThemeSetupUrl,
isActivatingTheme,
hasActivatedTheme
} from 'state/themes/selectors';
Expand Down Expand Up @@ -63,6 +64,12 @@ const ThanksModal = React.createClass( {
},

renderWpcomInfo() {
const themeSetup = translate( 'Make your site look like the demo with {{a}}Theme Setup{{/a}}.', {
components: {
a: <a href={ this.props.themeSetupUrl }
onClick={ this.onLinkClick( 'setup' ) } />
}
} );
const features = translate( "Discover this theme's {{a}}awesome features.{{/a}}", {
components: {
a: <a href={ this.props.detailsUrl }
Expand All @@ -77,6 +84,9 @@ const ThanksModal = React.createClass( {
} );
return (
<ul>
<li>
{ themeSetup }
</li>
<li>
{ this.props.source === 'list' ? features : customize }
</li>
Expand Down Expand Up @@ -208,6 +218,7 @@ export default connect(

return {
currentTheme,
themeSetupUrl: site && getThemeSetupUrl( state, site.ID ),
detailsUrl: site && getThemeDetailsUrl( state, currentTheme, site.ID ),
customizeUrl: site && getThemeCustomizeUrl( state, currentTheme, site.ID ),
forumUrl: getThemeForumUrl( state, currentThemeId ),
Expand Down
15 changes: 15 additions & 0 deletions client/state/themes/selectors.js
Expand Up @@ -415,6 +415,21 @@ export function getThemeCustomizeUrl( state, theme, siteId ) {
return customizeUrl;
}

/**
* Returns the URL for running Theme Setup on the current site (Headstart on demand).
*
* @param {Object} state Global state tree
* @param {Object} siteId Site ID
* @return {String} Theme Setup URL
*/
export function getThemeSetupUrl( state, siteId ) {
if ( ! siteId ) {
return '/settings/theme-setup/';
}
const siteSlug = getSiteSlug( state, siteId );
return '/settings/theme-setup/' + siteSlug;
}

/**
* Returns the URL for signing up for a new WordPress.com account with the given theme pre-selected.
*
Expand Down

0 comments on commit f1b085d

Please sign in to comment.