-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jetpack Licenses: Dynamic primary button label and link after product…
… activation (#22207) Co-authored-by: Jeremy Herve <jeremy@jeremy.hu> Co-authored-by: Renzo Canepa <rcanepag@gmail.com>
- Loading branch information
1 parent
6199c76
commit 99bfbc8
Showing
9 changed files
with
122 additions
and
57 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/js-packages/licensing/changelog/update-activation-complete-primary-button-link
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,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Link primary button after activation to Recommendations section if not seen before. |
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
38 changes: 38 additions & 0 deletions
38
...ts/js-packages/licensing/components/activation-screen-success-info/primary-link/index.jsx
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,38 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import { Button } from '@wordpress/components'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
/** | ||
* Style dependencies | ||
*/ | ||
import './style.scss'; | ||
|
||
const PrimaryLink = props => { | ||
const { currentRecommendationsStep, siteAdminUrl } = props; | ||
|
||
// If the user has not completed the first step of the Assistant, make the primary button link to it. | ||
if ( currentRecommendationsStep === 'not-started' ) { | ||
return ( | ||
<Button className="jp-license-activation-screen-success-info--button" href={ siteAdminUrl + 'admin.php?page=jetpack#/recommendations' }> | ||
{ __( 'Configure my site', 'jetpack' ) } | ||
</Button> | ||
); | ||
} | ||
|
||
return ( | ||
<Button className="jp-license-activation-screen-success-info--button" href={ siteAdminUrl + 'admin.php?page=jetpack#/my-plan' }> | ||
{ __( 'View my plans', 'jetpack' ) } | ||
</Button> | ||
); | ||
}; | ||
|
||
PrimaryLink.propTypes = { | ||
siteAdminUrl: PropTypes.string.isRequired, | ||
currentRecommendationsStep: PropTypes.string, | ||
}; | ||
|
||
export { PrimaryLink }; |
46 changes: 46 additions & 0 deletions
46
...s/js-packages/licensing/components/activation-screen-success-info/primary-link/style.scss
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,46 @@ | ||
@import '~@automattic/jetpack-base-styles/style'; | ||
|
||
.jp-license-activation-screen-success-info--button, | ||
.jp-license-activation-screen-success-info--button:active, | ||
.jp-license-activation-screen-success-info--button:visited { | ||
background-color: var( --jp-black ); | ||
border-radius: 4px; | ||
color: var( --jp-white ); | ||
font-size: 16px; | ||
font-size: var(--font-body); | ||
font-style: normal; | ||
font-weight: 600; | ||
justify-content: center; | ||
line-height: 24px; | ||
margin-top: 24px; | ||
min-height: 48px; | ||
min-width: 158px; | ||
padding: 13.5px 45px 13.5px 45px; | ||
width: 100%; | ||
margin: 0 40px 20px 0; | ||
|
||
@media screen and (min-width: 480px) { | ||
width: auto; | ||
} | ||
|
||
&:hover { | ||
background-color: var( --jp-black-80 ); | ||
color: var( --jp-white ); | ||
} | ||
|
||
&:focus { | ||
background-color: var( --jp-black-80 ); | ||
border: 1px solid var( --jp-white ); | ||
color: var( --jp-white ); | ||
} | ||
|
||
&[disabled], | ||
&:disabled { | ||
background-color: var( --jp-gray ); | ||
color: var( --jp-gray-20 );; | ||
} | ||
|
||
.jp-components-spinner { | ||
width: 100%; | ||
} | ||
} |
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
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/update-activation-complete-primary-button-link
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,4 @@ | ||
Significance: minor | ||
Type: enhancement | ||
|
||
Provide recommendation step parameter to external package and also update package dependencies. |