Skip to content

Commit

Permalink
[not verified] Story block: remove wp-components frontend dep
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomes committed Feb 10, 2023
1 parent 80d0c83 commit 0f8e439
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: enhancement

Story block: remove dependency on wp-components from the frontend code
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/extensions/blocks/story/icon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Path, G } from '@wordpress/components';
import { Path, G } from '@wordpress/primitives';
import renderMaterialIcon from '../../shared/render-material-icon';

const icon = renderMaterialIcon(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SVG } from '@wordpress/components';
import { SVG } from '@wordpress/primitives';

export default function Background( { currentMedia } ) {
const url = currentMedia && currentMedia.type === 'image' ? currentMedia.url : null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Button } from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';
import classNames from 'classnames';

Expand All @@ -19,7 +18,7 @@ export default function Bullet( { isEllipsis, disabled, index, isSelected, progr
);
}
return (
<Button
<button
role={ bulletDisabled ? 'presentation' : 'tab' }
key={ index }
className={ classNames( 'wp-story-pagination-bullet', {
Expand All @@ -36,6 +35,6 @@ export default function Bullet( { isEllipsis, disabled, index, isSelected, progr
style={ { width: `${ progress }%` } }
></div>
</div>
</Button>
</button>
);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Path } from '@wordpress/components';
import { Path } from '@wordpress/primitives';
import renderMaterialIcon from '../../../../shared/render-material-icon';

const MaterialIcon = ( { children, size } ) => renderMaterialIcon( children, size, size );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Path, SVG } from '@wordpress/components';
import { Path, SVG } from '@wordpress/primitives';

const renderMaterialIcon = ( svg, width = 24, height = 24, viewbox = '0 0 24 24' ) => (
<SVG xmlns="http://www.w3.org/2000/svg" width={ width } height={ height } viewBox={ viewbox }>
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/tools/check-block-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@
'lodash',
'react',
'react-dom',
'wp-components',
'wp-compose',
'wp-data',
'wp-element',
'wp-keycodes',
'wp-primitives',
),
);

Expand Down

0 comments on commit 0f8e439

Please sign in to comment.