-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Boost: Migrate Tips to react (#34697)
* Update Tips to react * add changelog
- Loading branch information
Showing
6 changed files
with
70 additions
and
55 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
45 changes: 0 additions & 45 deletions
45
projects/plugins/boost/app/assets/src/js/layout/SettingsPage/Tips.svelte
This file was deleted.
Oops, something went wrong.
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
53 changes: 53 additions & 0 deletions
53
projects/plugins/boost/app/assets/src/js/layout/SettingsPage/tips/tips.tsx
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,53 @@ | ||
import { getRedirectUrl } from '@automattic/jetpack-components'; | ||
import { createInterpolateElement } from '@wordpress/element'; | ||
import { __ } from '@wordpress/i18n'; | ||
import styles from './tips.module.scss'; | ||
|
||
const Tips = () => { | ||
const pingdomLink = getRedirectUrl( 'jetpack-boost-pingdom' ); | ||
const whySpeedLink = getRedirectUrl( 'jetpack-boost-why-speed' ); | ||
|
||
return ( | ||
<div className="jb-section jb-section--alt"> | ||
<div className="jb-container--narrow"> | ||
<div className={ styles.tips }> | ||
<h3 className={ styles[ 'tips-title' ] }>{ __( 'Did you know?', 'jetpack-boost' ) }</h3> | ||
<div className={ styles[ 'tips-items' ] }> | ||
<div className={ styles.item }> | ||
<div className={ styles[ 'item-rate' ] }>4x</div> | ||
<div className={ styles[ 'item-description' ] }> | ||
{ createInterpolateElement( | ||
__( | ||
`Pages that take over 3 seconds to load have 4x the bounce rate of pages that load in 2 seconds or less. (source: <link>Pingdom</link>).`, | ||
'jetpack-boost' | ||
), | ||
{ | ||
// eslint-disable-next-line jsx-a11y/anchor-has-content | ||
link: <a href={ pingdomLink } target="_blank" rel="noopener noreferrer" />, | ||
} | ||
) } | ||
</div> | ||
</div> | ||
<div className={ styles.item }> | ||
<div className={ styles[ 'item-rate' ] }>20%</div> | ||
<div className={ styles[ 'item-description' ] }> | ||
{ createInterpolateElement( | ||
__( | ||
`A one-second delay in loading times can reduce conversion rates by 20%. (source: <link>Google</link>).`, | ||
'jetpack-boost' | ||
), | ||
{ | ||
// eslint-disable-next-line jsx-a11y/anchor-has-content | ||
link: <a href={ whySpeedLink } target="_blank" rel="noopener noreferrer" />, | ||
} | ||
) } | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Tips; |
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,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Migrate Settings Page Tips to react. | ||
|
||
|