-
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.
[not verified] Update to match new design
- Loading branch information
1 parent
613ce3c
commit 5734db4
Showing
7 changed files
with
143 additions
and
118 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
projects/plugins/jetpack/extensions/plugins/publicize/components/connection-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,35 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { SocialServiceIcon } from '../../../../shared/icons'; | ||
|
||
/** | ||
* Style dependencies | ||
*/ | ||
import './style.scss'; | ||
|
||
type ConnectionIconProps = { | ||
id: string; | ||
serviceName: string; | ||
label: string; | ||
profilePicture: string; | ||
}; | ||
|
||
const ConnectionIcon: React.FC< ConnectionIconProps > = props => { | ||
const { id, serviceName, label, profilePicture } = props; | ||
|
||
return ( | ||
<label htmlFor={ id } className="jetpack-publicize-connection-label"> | ||
<div className="components-connection-icon__picture"> | ||
{ profilePicture ? <img src={ profilePicture } /> : <span className="placeholder" /> } | ||
<SocialServiceIcon | ||
serviceName={ serviceName } | ||
className="jetpack-publicize-gutenberg-social-icon" | ||
/> | ||
</div> | ||
<span className="jetpack-publicize-connection-label-copy">{ label }</span> | ||
</label> | ||
); | ||
}; | ||
|
||
export default ConnectionIcon; |
32 changes: 32 additions & 0 deletions
32
projects/plugins/jetpack/extensions/plugins/publicize/components/connection-icon/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,32 @@ | ||
.jetpack-publicize-connection-label { | ||
display: flex; | ||
align-items: center; | ||
|
||
// Icon and picture. | ||
.components-connection-icon__picture { | ||
display: grid; | ||
|
||
img, | ||
.placeholder { | ||
border-radius: 2px; | ||
width: 24px; | ||
height: 24px; | ||
grid-area: 1 / 1 / 2 / 2; | ||
} | ||
|
||
.placeholder { | ||
display: block; | ||
background-color: #a8bece; | ||
} | ||
|
||
svg { | ||
width: 15px; | ||
height: 15px; | ||
grid-area: 1 / 1 / 2 / 2; | ||
margin-top: 14px; | ||
margin-left: 14px; | ||
border-radius: 1px; | ||
background-color: white; | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
projects/plugins/jetpack/extensions/plugins/publicize/components/connection-toggle/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,53 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import classnames from 'classnames'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { FormToggle } from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import ConnectionIcon from '../connection-icon'; | ||
|
||
/** | ||
* Style dependencies | ||
*/ | ||
import './style.scss'; | ||
|
||
type ConnectionToggleProps = { | ||
className: string; | ||
checked: boolean; | ||
id: string; | ||
disabled: boolean; | ||
onChange: () => void; | ||
serviceName: string; | ||
label: string; | ||
profilePicture: string; | ||
}; | ||
|
||
const ConnectionToggle: React.FC< ConnectionToggleProps > = props => { | ||
const { className, checked, id, disabled, onChange, serviceName, label, profilePicture } = props; | ||
|
||
const wrapperClasses = classnames( 'components-connection-toggle', { | ||
'is-not-checked': ! checked, | ||
'is-disabled': disabled, | ||
} ); | ||
|
||
return ( | ||
<div className={ wrapperClasses }> | ||
<ConnectionIcon | ||
id={ id } | ||
serviceName={ serviceName } | ||
label={ label } | ||
profilePicture={ profilePicture } | ||
/> | ||
<FormToggle id={ id } className={ className } checked={ checked } onChange={ onChange } /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ConnectionToggle; |
17 changes: 17 additions & 0 deletions
17
...ects/plugins/jetpack/extensions/plugins/publicize/components/connection-toggle/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,17 @@ | ||
.components-connection-toggle { | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
width: 100%; | ||
|
||
// Unchecked state. | ||
&.is-not-checked .jetpack-gutenberg-social-icon { | ||
fill: #dadada; | ||
} | ||
|
||
// Disabled state: | ||
&.is-disabled, | ||
.components-disabled & { | ||
opacity: 0.3; | ||
} | ||
} |
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
64 changes: 0 additions & 64 deletions
64
...ects/plugins/jetpack/extensions/plugins/publicize/components/publicize-checkbox/index.tsx
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
...cts/plugins/jetpack/extensions/plugins/publicize/components/publicize-checkbox/style.scss
This file was deleted.
Oops, something went wrong.