Skip to content
Open
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: 3 additions & 0 deletions pnpm-lock.yaml

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

4 changes: 4 additions & 0 deletions projects/js-packages/components/changelog/rna-gridicon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: removed

Remove Gridicon component. Use Icon and named icon exports from `@wordpress/icons` instead.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { __ } from '@wordpress/i18n';
import { Icon, desktop, mobile } from '@wordpress/icons';
import clsx from 'clsx';
import Gridicon from '../gridicon/index.tsx';
import type { BoostScoreBarProps } from './types.ts';
import type { FunctionComponent } from 'react';

Expand All @@ -25,10 +25,10 @@ export const BoostScoreBar: FunctionComponent< BoostScoreBarProps > = ( {

const getIcon = () => {
if ( scoreBarType === 'desktop' ) {
return <Gridicon icon="computer" size={ 24 } />;
return <Icon icon={ desktop } size={ 24 } />;
}

return <Gridicon icon="phone" size={ 24 } />;
return <Icon icon={ mobile } size={ 24 } />;
};

const getFillColor = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ describe( 'BoostScrollBar', () => {
const { container } = render( <BoostScoreBar { ...defaultProps } scoreBarType="mobile" /> );

expect( screen.getByText( 'Mobile score' ) ).toBeInTheDocument();
expect( container.querySelector( '.gridicons-phone' ) ).toBeInTheDocument();
expect( container.querySelector( '.jb-score-bar__label svg' ) ).toBeInTheDocument();
} );

it( 'renders desktop icon and text when scoreBarType is desktop', () => {
const { container } = render( <BoostScoreBar { ...defaultProps } /> );

expect( screen.getByText( 'Desktop score' ) ).toBeInTheDocument();
expect( container.querySelector( '.gridicons-computer' ) ).toBeInTheDocument();
expect( container.querySelector( '.jb-score-bar__label svg' ) ).toBeInTheDocument();
} );

it( 'renders previous scores when showPrevScores is true', () => {
Expand Down
334 changes: 0 additions & 334 deletions projects/js-packages/components/components/gridicon/index.tsx

This file was deleted.

Loading
Loading