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

add default (= null) for classNames prop so it's optional for WizardTaskItem and CollapsibleBody #9157

Merged
merged 12 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/fix-9142-classname-optional-default-null
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev

Default classNames prop to null so components are more flexible/easier to use.
2 changes: 1 addition & 1 deletion client/additional-methods-setup/wizard/collapsible-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import classNames from 'classnames';
import WizardTaskContext from './task/context';
import './collapsible-body.scss';

const CollapsibleBody = ( { className, ...restProps } ) => {
const CollapsibleBody = ( { className = '', ...restProps } ) => {
const { isActive } = useContext( WizardTaskContext );

return (
Expand Down
2 changes: 1 addition & 1 deletion client/additional-methods-setup/wizard/task-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Icon, check } from '@wordpress/icons';
import WizardTaskContext from './task/context';
import './task-item.scss';

const WizardTaskItem = ( { children, title, index, className } ) => {
const WizardTaskItem = ( { children, title, index, className = '' } ) => {
const { isCompleted, isActive } = useContext( WizardTaskContext );

return (
Expand Down
2 changes: 1 addition & 1 deletion client/multi-currency-setup/wizard/task-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const WizardTaskItem = ( {
children,
title,
index,
className,
visibleDescription,
className = '',
} ) => {
const { isCompleted, isActive } = useContext( WizardTaskContext );

Expand Down
3 changes: 1 addition & 2 deletions client/vat/form/tasks/company-data-task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ export const CompanyDataTask = ( {
'Confirm your business details',
'woocommerce-payments'
) }
className={ null }
>
<CollapsibleBody className={ null }>
<CollapsibleBody>
<TextControl
label={ __( 'Business name', 'woocommerce-payments' ) }
value={ companyName }
Expand Down
3 changes: 1 addition & 2 deletions client/vat/form/tasks/vat-number-task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export const VatNumberTask = ( {
),
getVatTaxIDName()
) }
className={ null }
>
<p className="wcpay-wizard-task__description-element">
{ __(
Expand All @@ -168,7 +167,7 @@ export const VatNumberTask = ( {
) }
</p>

<CollapsibleBody className={ null }>
<CollapsibleBody>
<CheckboxControl
checked={ isVatRegistered }
onChange={ setVatRegistered }
Expand Down
Loading