-
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.
Use react router for threat history, separate scan and history root c…
…omponents, minor UI adjustments
- Loading branch information
1 parent
be29dc8
commit e2c9aee
Showing
36 changed files
with
869 additions
and
530 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
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
24 changes: 24 additions & 0 deletions
24
projects/plugins/protect/src/js/components/button-group/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,24 @@ | ||
import { Button } from '@automattic/jetpack-components'; | ||
import { ButtonGroup as WordPressButtonGroup } from '@wordpress/components'; | ||
import React from 'react'; | ||
import styles from './styles.module.scss'; | ||
|
||
/** | ||
* Button Group | ||
* | ||
* @param {object} props - Component props. | ||
* @param { React.ReactNode } props.children - Component children. | ||
* | ||
* @returns { React.ReactNode } The Button Group component. | ||
*/ | ||
function ButtonGroup( { children, ...props } ) { | ||
return ( | ||
<WordPressButtonGroup className={ styles[ 'button-group' ] } { ...props }> | ||
{ children } | ||
</WordPressButtonGroup> | ||
); | ||
} | ||
|
||
ButtonGroup.Button = props => <Button { ...props } />; | ||
|
||
export default ButtonGroup; |
18 changes: 18 additions & 0 deletions
18
projects/plugins/protect/src/js/components/button-group/stories/index.stories.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,18 @@ | ||
/* eslint-disable react/react-in-jsx-scope */ | ||
import { Button } from '@automattic/jetpack-components'; | ||
import React from 'react'; | ||
import ButtonGroup from '../index.jsx'; | ||
|
||
export default { | ||
title: 'Plugins/Protect/Button Group', | ||
component: ButtonGroup, | ||
argTypes: {}, | ||
}; | ||
|
||
const Template = args => ( | ||
<ButtonGroup { ...args }> | ||
<Button>Button 1</Button> | ||
<Button>Button 2</Button> | ||
</ButtonGroup> | ||
); | ||
export const Default = Template.bind( {} ); |
22 changes: 22 additions & 0 deletions
22
projects/plugins/protect/src/js/components/button-group/styles.module.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,22 @@ | ||
.button-group { | ||
:global .components-button { | ||
position: relative; | ||
box-shadow: inset 0 0 0 1.5px var( --jp-gray ); | ||
|
||
&:first-child { | ||
border-radius: var(--jp-border-radius) 0 0 var(--jp-border-radius); | ||
} | ||
|
||
&:last-child { | ||
border-radius: 0 var(--jp-border-radius) var(--jp-border-radius) 0; | ||
} | ||
|
||
&:hover { | ||
z-index: 1; | ||
} | ||
|
||
+ .components-button { | ||
margin-left: -1.5px; | ||
} | ||
} | ||
} |
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
25 changes: 25 additions & 0 deletions
25
projects/plugins/protect/src/js/components/protect-check-icon/index.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,25 @@ | ||
import { type JSX } from 'react'; | ||
|
||
/** | ||
* Protect Shield and Checkmark SVG Icon | ||
* | ||
* @returns {JSX.Element} Protect Shield and Checkmark SVG Icon | ||
*/ | ||
export default function ProtectCheck(): JSX.Element { | ||
return ( | ||
<svg width="80" height="96" viewBox="0 0 80 96" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M40 0.00634766L80 17.7891V44.2985C80 66.8965 65.1605 88.2927 44.2352 95.0425C41.4856 95.9295 38.5144 95.9295 35.7648 95.0425C14.8395 88.2927 0 66.8965 0 44.2985V17.7891L40 0.00634766Z" | ||
fill="#069E08" | ||
/> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M60.9 33.6909L35.375 67.9124L19.2047 55.9263L22.7848 51.1264L34.1403 59.5436L56.0851 30.122L60.9 33.6909Z" | ||
fill="white" | ||
/> | ||
</svg> | ||
); | ||
} |
Oops, something went wrong.