Skip to content
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

Button Component: update to use non-deprecated attributes #23242

Merged
merged 11 commits into from
Mar 7, 2022
32 changes: 16 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Components: update attributes used within the Button component to match recent deprecations and changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ActionButton = props => {
className="jp-action-button--button"
label={ label }
onClick={ onClick }
isPrimary
variant="primary"
disabled={ isLoading }
>
{ isLoading ? <Spinner /> : label }
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-components",
"version": "0.10.7",
"version": "0.10.8-alpha",
"description": "Jetpack Components Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Components: update attributes used within the Button component to match recent deprecations and changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const ConnectionStatusCard = props => {
>
{ requiresUserConnection && __( 'Requires user connection.', 'jetpack' ) }{ ' ' }
<Button
isLink
variant="link"
disabled={ userIsConnecting }
onClick={ handleConnectUser }
className="jp-connection-status-card--btn-connect-user"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const StepDisconnectConfirm = props => {
</p>
<p>
<Button
isPrimary
variant="primary"
onClick={ onProvideFeedback }
className="jp-connection__disconnect-dialog__btn-back-to-wp"
>
Expand All @@ -68,7 +68,7 @@ const StepDisconnectConfirm = props => {
<>
<p>
<Button
isPrimary
variant="primary"
onClick={ onExit }
className="jp-connection__disconnect-dialog__btn-back-to-wp"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const StepDisconnect = props => {

return (
<Button
isPrimary
variant="primary"
disabled={ isDisconnecting }
onClick={ handleDisconnectClick }
className="jp-connection__disconnect-dialog__btn-disconnect"
Expand Down Expand Up @@ -152,7 +152,7 @@ const StepDisconnect = props => {
</div>
<div className="jp-connection__disconnect-dialog__button-wrap lg-col-span-5 md-col-span-8 sm-col-span-4">
<Button
isPrimary
variant="primary"
disabled={ isDisconnecting }
onClick={ handleStayConnectedClick }
className="jp-connection__disconnect-dialog__btn-dismiss"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const StepThankYou = props => {
) }
</p>
<Button
isPrimary
variant="primary"
onClick={ onExit }
className="jp-connection__disconnect-dialog__btn-back-to-wp"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const DisconnectSurvey = props => {
<p>
<Button
disabled={ ! selectedAnswer || isSubmittingFeedback }
isPrimary
variant="primary"
onClick={ handleSurveySubmit }
className="jp-connection__disconnect-dialog__btn-back-to-wp"
>
Expand Down
4 changes: 2 additions & 2 deletions projects/js-packages/connection/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@automattic/jetpack-connection",
"version": "0.17.0",
"version": "0.17.1-alpha",
"description": "Jetpack Connection Component",
"author": "Automattic",
"license": "GPL-2.0-or-later",
"dependencies": {
"@automattic/jetpack-analytics": "workspace:^0.1.8",
"@automattic/jetpack-config": "workspace:^0.1.3",
"@automattic/jetpack-components": "workspace:^0.10.7",
"@automattic/jetpack-components": "workspace:^0.10.8-alpha",
"@automattic/jetpack-api": "workspace:^0.9.1",
"@wordpress/base-styles": "4.1.1",
"@wordpress/browserslist-config": "4.1.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
4 changes: 2 additions & 2 deletions projects/js-packages/idc/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@automattic/jetpack-idc",
"version": "0.10.0",
"version": "0.10.1-alpha",
"description": "Jetpack Connection Component",
"author": "Automattic",
"license": "GPL-2.0-or-later",
"dependencies": {
"@automattic/jetpack-analytics": "workspace:^0.1.8",
"@automattic/jetpack-api": "workspace:^0.9.1",
"@automattic/jetpack-base-styles": "workspace:^0.1.9",
"@automattic/jetpack-components": "workspace:^0.10.7",
"@automattic/jetpack-components": "workspace:^0.10.8-alpha",
"@wordpress/base-styles": "4.1.1",
"@wordpress/components": "19.5.0",
"@wordpress/compose": "5.1.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
4 changes: 2 additions & 2 deletions projects/js-packages/licensing/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-licensing",
"version": "0.4.8",
"version": "0.4.9-alpha",
"description": "Jetpack licensing flow",
"homepage": "https://jetpack.com",
"bugs": {
Expand Down Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@automattic/jetpack-api": "workspace:^0.9.1",
"@automattic/jetpack-components": "workspace:^0.10.7",
"@automattic/jetpack-components": "workspace:^0.10.8-alpha",
"@wordpress/i18n": "4.3.1",
"@wordpress/element": "4.1.1",
"prop-types": "15.7.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
6 changes: 3 additions & 3 deletions projects/js-packages/partner-coupon/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-partner-coupon",
"version": "0.2.2",
"version": "0.2.3-alpha",
"description": "This package aims to add components to make it easier to redeem partner coupons",
"homepage": "https://jetpack.com",
"bugs": {
Expand Down Expand Up @@ -29,8 +29,8 @@
"react": "^17.0.2"
},
"dependencies": {
"@automattic/jetpack-components": "workspace:^0.10.7",
"@automattic/jetpack-connection": "workspace:^0.17.0",
"@automattic/jetpack-components": "workspace:^0.10.8-alpha",
"@automattic/jetpack-connection": "workspace:^0.17.1-alpha",
"@wordpress/i18n": "4.3.1",
"classnames": "2.3.1",
"prop-types": "15.7.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
4 changes: 2 additions & 2 deletions projects/packages/connection-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jetpack-connection-manager-ui",
"version": "2.3.8",
"version": "2.3.9-alpha",
"description": "Jetpack Connection Manager UI",
"main": "_inc/admin.jsx",
"repository": "https://github.com/Automattic/jetpack-connection-ui",
Expand All @@ -16,7 +16,7 @@
"browserslist": "extends @wordpress/browserslist-config",
"dependencies": {
"@automattic/jetpack-api": "workspace:^0.9.1",
"@automattic/jetpack-connection": "workspace:^0.17.0",
"@automattic/jetpack-connection": "workspace:^0.17.1-alpha",
"@wordpress/data": "6.3.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
4 changes: 2 additions & 2 deletions projects/packages/identity-crisis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jetpack-identity-crisis",
"version": "0.8.0",
"version": "0.8.1-alpha",
"description": "Jetpack Identity Crisis",
"main": "_inc/admin.jsx",
"repository": "https://github.com/Automattic/jetpack-identity-crisis",
Expand All @@ -15,7 +15,7 @@
},
"browserslist": "extends @wordpress/browserslist-config",
"dependencies": {
"@automattic/jetpack-idc": "workspace:^0.10.0",
"@automattic/jetpack-idc": "workspace:^0.10.1-alpha",
"@wordpress/data": "6.3.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Identity_Crisis {
/**
* Package Version
*/
const PACKAGE_VERSION = '0.8.0';
const PACKAGE_VERSION = '0.8.1-alpha';

/**
* Instance of the object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ActionButton = ( {
} ) => {
if ( ! admin ) {
return (
<Button isLink onClick={ onLearn } className={ styles[ 'action-link-button' ] }>
<Button variant="link" onClick={ onLearn } className={ styles[ 'action-link-button' ] }>
{
/* translators: placeholder is product name. */
sprintf( __( 'Learn about %s', 'jetpack-my-jetpack' ), name )
Expand All @@ -62,15 +62,15 @@ const ActionButton = ( {
}

const buttonState = {
isPrimary: ! isFetching,
variant: ! isFetching ? 'primary' : undefined,
disabled: isFetching,
};

switch ( status ) {
case PRODUCT_STATUSES.NEEDS_PURCHASE:
case PRODUCT_STATUSES.ABSENT:
return (
<Button isLink onClick={ onAdd } className={ styles[ 'action-link-button' ] }>
<Button variant="link" onClick={ onAdd } className={ styles[ 'action-link-button' ] }>
{
/* translators: placeholder is product name. */
sprintf( __( 'Add %s', 'jetpack-my-jetpack' ), name )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,13 @@ import React from 'react';
import { Button } from '@wordpress/components';
import { Spinner } from '@automattic/jetpack-components';

const ProductDetailButton = ( {
children,
className,
href,
isLoading,
onClick,
isPrimary,
isSecondary,
} ) => {
const ProductDetailButton = ( { children, className, href, isLoading, onClick, isPrimary } ) => {
return (
<Button
onClick={ onClick }
className={ className }
href={ href }
isPrimary={ isPrimary }
isSecondary={ isSecondary }
variant={ isPrimary ? 'primary' : 'secondary' }
>
{ isLoading ? <Spinner /> : children }
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ const ProductDetail = ( { slug, onClick, trackButtonClick } ) => {
onClick={ clickHandler }
isLoading={ isFetching }
isPrimary={ ! isBundle }
isSecondary={ isBundle }
href={ onClick ? undefined : addProductUrl }
className={ `${ styles[ 'checkout-button' ] } ${
isBundle ? styles[ 'is-bundle' ] : ''
Expand Down
Loading