Skip to content

Commit

Permalink
[not verified] Swap out TS files for JS files
Browse files Browse the repository at this point in the history
  • Loading branch information
allilevine committed Oct 27, 2021
1 parent 702811e commit 5f5409a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* External dependencies
*/
import PropTypes from 'prop-types';

/**
* Internal dependencies
*/
Expand All @@ -8,20 +13,17 @@ import { SocialServiceIcon } from '../../../../shared/icons';
*/
import './style.scss';

type ConnectionIconProps = {
id: string;
serviceName: string;
label: string;
profilePicture: string;
};

const ConnectionIcon: React.FC< ConnectionIconProps > = props => {
const ConnectionIcon = 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" /> }
{ profilePicture ? (
<img src={ profilePicture } alt={ label } />
) : (
<span className="placeholder" />
) }
<SocialServiceIcon
serviceName={ serviceName }
className="jetpack-publicize-gutenberg-social-icon"
Expand All @@ -32,4 +34,11 @@ const ConnectionIcon: React.FC< ConnectionIconProps > = props => {
);
};

ConnectionIcon.propTypes = {
id: PropTypes.string.isRequired,
serviceName: PropTypes.string,
label: PropTypes.string,
profilePicture: PropTypes.string,
};

export default ConnectionIcon;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import PropTypes from 'prop-types';

/**
* WordPress dependencies
Expand All @@ -18,18 +19,7 @@ import ConnectionIcon from '../connection-icon';
*/
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 ConnectionToggle = props => {
const { className, checked, id, disabled, onChange, serviceName, label, profilePicture } = props;

const wrapperClasses = classnames( 'components-connection-toggle', {
Expand All @@ -56,4 +46,15 @@ const ConnectionToggle: React.FC< ConnectionToggleProps > = props => {
);
};

ConnectionToggle.propTypes = {
className: PropTypes.string,
checked: PropTypes.bool,
id: PropTypes.string.isRequired,
disabled: PropTypes.bool,
onChange: PropTypes.func,
serviceName: PropTypes.string,
label: PropTypes.string,
profilePicture: PropTypes.string,
};

export default ConnectionToggle;

0 comments on commit 5f5409a

Please sign in to comment.