-
Notifications
You must be signed in to change notification settings - Fork 844
Protect: Add Home page #40317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Protect: Add Home page #40317
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
31e2898
Init project branch
nateweller f683c17
Init project branch
nateweller feb7c27
Protect: add ShieldIcon component
nateweller 941941d
Protect: add home page
e9c5bb4
changelog
nateweller 64a06da
Fix translated string concat
nateweller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Protect: add home page
Rebase on admin hero section refactor Revert accidental type changes Remove testing code Init project branch Protect: Add ShieldIcon Component (#40402) Refactor AdminSectionHero component
- Loading branch information
commit 941941d0cc5675dc8acfdb93f84ed984e1c282d0
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 | ||
|
|
||
| Adds a Home page and StatCards |
This file contains hidden or 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 hidden or 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 hidden or 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
73 changes: 0 additions & 73 deletions
73
projects/plugins/protect/src/js/components/seventy-five-layout/index.tsx
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
projects/plugins/protect/src/js/components/seventy-five-layout/styles.module.scss
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
52 changes: 52 additions & 0 deletions
52
projects/plugins/protect/src/js/routes/home/home-admin-section-hero.tsx
This file contains hidden or 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,52 @@ | ||
| import { Text, Button } from '@automattic/jetpack-components'; | ||
| import { __, sprintf } from '@wordpress/i18n'; | ||
| import { useCallback } from 'react'; | ||
| import { useNavigate } from 'react-router-dom'; | ||
| import AdminSectionHero from '../../components/admin-section-hero'; | ||
| import usePlan from '../../hooks/use-plan'; | ||
| import HomeStatCards from './home-statcards'; | ||
| import styles from './styles.module.scss'; | ||
|
|
||
| const HomeAdminSectionHero: React.FC = () => { | ||
| const { hasPlan } = usePlan(); | ||
| const navigate = useNavigate(); | ||
| const handleScanReportClick = useCallback( () => { | ||
| navigate( '/scan' ); | ||
| }, [ navigate ] ); | ||
|
|
||
| return ( | ||
| <AdminSectionHero> | ||
| <AdminSectionHero.Main> | ||
| <> | ||
| <AdminSectionHero.Heading> | ||
| { __( 'Your site is safe with us', 'jetpack-protect' ) } | ||
| </AdminSectionHero.Heading> | ||
| <Text> | ||
| { sprintf( | ||
| // translators: %s is replaced with "threats" or "vulnerabilities" depending on the user's plan. | ||
| __( 'We stay ahead of security %s to keep your site protected.', 'jetpack-protect' ), | ||
| hasPlan | ||
| ? __( 'threats', 'jetpack-protect' ) | ||
| : __( | ||
| 'vulnerabilities', | ||
| 'jetpack-protect', | ||
| /* dummy arg to avoid bad minification */ 0 | ||
| ) | ||
| ) } | ||
| </Text> | ||
| <Button | ||
| className={ styles[ 'view-scan-report' ] } | ||
| variant="primary" | ||
| weight="regular" | ||
| onClick={ handleScanReportClick } | ||
| > | ||
| { __( 'View scan report', 'jetpack-protect' ) } | ||
| </Button> | ||
| </> | ||
| </AdminSectionHero.Main> | ||
| <AdminSectionHero.Aside>{ <HomeStatCards /> }</AdminSectionHero.Aside> | ||
| </AdminSectionHero> | ||
| ); | ||
| }; | ||
|
|
||
| export default HomeAdminSectionHero; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes stats available regardless of plan