Skip to content

Commit

Permalink
Remove checkboxId prop
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Jan 29, 2024
1 parent 77407a5 commit 9f2026b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
/**
* WordPress dependencies
*/
import {
CheckboxControl,
Flex,
privateApis as componentsPrivateApis,
} from '@wordpress/components';
import { CheckboxControl, Flex } from '@wordpress/components';

/**
* Internal dependencies
*/
import { getFontFaceVariantName } from './utils';
import FontFaceDemo from './font-demo';
import { unlock } from '../../../lock-unlock';

function CollectionFontVariant( {
face,
Expand All @@ -29,10 +24,6 @@ function CollectionFontVariant( {
};

const displayName = font.name + ' ' + getFontFaceVariantName( face );
const { kebabCase } = unlock( componentsPrivateApis );
const checkboxId = kebabCase(
`${ font.slug }-${ getFontFaceVariantName( face ) }`
);

return (
<div className="font-library-modal__library-font-variant">
Expand All @@ -46,7 +37,6 @@ function CollectionFontVariant( {
<FontFaceDemo
fontFace={ face }
text={ displayName }
checkboxId={ checkboxId }
onClick={ handleToggleActivation }
/>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function FontFaceDemo( {
customPreviewUrl,
fontFace,
text,
checkboxId,
onClick,
style = {},
} ) {
Expand Down Expand Up @@ -77,7 +76,6 @@ function FontFaceDemo( {
return (
<div
ref={ ref }
id={ checkboxId }
onClick={ onClick }
onKeyDown={ onClick }
tabIndex={ -1 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@
* WordPress dependencies
*/
import { useContext } from '@wordpress/element';
import {
CheckboxControl,
Flex,
privateApis as componentsPrivateApis,
} from '@wordpress/components';
import { CheckboxControl, Flex } from '@wordpress/components';

/**
* Internal dependencies
*/
import { getFontFaceVariantName } from './utils';
import { FontLibraryContext } from './context';
import FontFaceDemo from './font-demo';
import { unlock } from '../../../lock-unlock';

function LibraryFontVariant( { face, font } ) {
const { isFontActivated, toggleActivateFont } =
Expand All @@ -39,10 +34,6 @@ function LibraryFontVariant( { face, font } ) {
};

const displayName = font.name + ' ' + getFontFaceVariantName( face );
const { kebabCase } = unlock( componentsPrivateApis );
const checkboxId = kebabCase(
`${ font.slug }-${ getFontFaceVariantName( face ) }`
);

return (
<div className="font-library-modal__library-font-variant">
Expand All @@ -56,7 +47,6 @@ function LibraryFontVariant( { face, font } ) {
<FontFaceDemo
fontFace={ face }
text={ displayName }
checkboxId={ checkboxId }
onClick={ handleToggleActivation }
/>
</Flex>
Expand Down

0 comments on commit 9f2026b

Please sign in to comment.