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

Remove useless clsx calls. #61969

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions packages/block-library/src/site-logo/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const SiteLogo = ( {
const [ { naturalWidth, naturalHeight }, setNaturalSize ] = useState( {} );
const [ isEditingImage, setIsEditingImage ] = useState( false );
const { toggleSelection } = useDispatch( blockEditorStore );
const classes = clsx( 'custom-logo-link' );
const { imageEditing, maxWidth, title } = useSelect( ( select ) => {
const settings = select( blockEditorStore ).getSettings();
const siteEntities = select( coreStore ).getEntityRecord(
Expand Down Expand Up @@ -136,7 +135,7 @@ const SiteLogo = ( {
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
<a
href={ siteUrl }
className={ classes }
className="custom-logo-link"
rel="home"
title={ title }
onClick={ ( event ) => event.preventDefault() }
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/animate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getDefaultOrigin( type?: GetAnimateOptions[ 'type' ] ) {
*/
export function getAnimateClassName( options: GetAnimateOptions ) {
if ( options.type === 'loading' ) {
return clsx( 'components-animate__loading' );
return 'components-animate__loading';
}

const { type, origin = getDefaultOrigin( type ) } = options;
Expand Down
11 changes: 7 additions & 4 deletions packages/components/src/focal-point-picker/focal-point.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { PointerCircle } from './styles/focal-point-style';
/**
* External dependencies
*/
import clsx from 'clsx';
import type { FocalPointProps } from './types';
import type { WordPressComponentProps } from '../context';

Expand All @@ -15,9 +14,13 @@ export default function FocalPoint( {
top = '50%',
...props
}: WordPressComponentProps< FocalPointProps, 'div' > ) {
const classes = clsx( 'components-focal-point-picker__icon_container' );

const style = { left, top };

return <PointerCircle { ...props } className={ classes } style={ style } />;
return (
<PointerCircle
{ ...props }
className="components-focal-point-picker__icon_container"
style={ style }
/>
);
}
4 changes: 1 addition & 3 deletions packages/edit-site/src/components/save-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ export default function SavePanel() {
>
<Button
variant="secondary"
className={ clsx(
'edit-site-editor__toggle-save-panel-button'
) }
className="edit-site-editor__toggle-save-panel-button"
onClick={ () => setIsSaveViewOpened( true ) }
aria-haspopup={ 'dialog' }
disabled={ disabled }
Expand Down
10 changes: 5 additions & 5 deletions storybook/decorators/with-global-css.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* External dependencies
*/
import clsx from 'clsx';

/**
* WordPress dependencies
*/
Expand All @@ -14,6 +9,11 @@ import { useEffect } from '@wordpress/element';
import basicStyles from '../global-basic.lazy.scss';
import wordPressStyles from '../global-wordpress.lazy.scss';

/**
* External dependencies
*/
import clsx from 'clsx';

/**
* A Storybook decorator to inject global CSS.
*
Expand Down
Loading