-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
feb7c27
commit 941941d
Showing
14 changed files
with
447 additions
and
93 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,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Adds a Home page and StatCards |
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
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 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
52 changes: 52 additions & 0 deletions
52
projects/plugins/protect/src/js/routes/home/home-admin-section-hero.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,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.