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

Replace all occurences of the yes dashicon with the check icon from the icons package #19926

Merged
merged 2 commits into from
Jan 30, 2020
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
1 change: 1 addition & 0 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions packages/components/src/checkbox-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* WordPress dependencies
*/
import { useInstanceId } from '@wordpress/compose';
import { Icon, check } from '@wordpress/icons';

/**
* Internal dependencies
*/
import BaseControl from '../base-control';
import Dashicon from '../dashicon';

export default function CheckboxControl( { label, className, heading, checked, help, onChange, ...props } ) {
const instanceId = useInstanceId( CheckboxControl );
Expand All @@ -27,7 +27,7 @@ export default function CheckboxControl( { label, className, heading, checked, h
aria-describedby={ !! help ? id + '__help' : undefined }
{ ...props }
/>
{ checked ? <Dashicon icon="yes" className="components-checkbox-control__checked" role="presentation" /> : null }
{ checked ? <Icon icon={ check } className="components-checkbox-control__checked" role="presentation" /> : null }
</span>
<label className="components-checkbox-control__label" htmlFor={ id }>
{ label }
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/checkbox-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ $checkbox-input-size-sm: 25px; // width + height for small viewports
}
}

svg.dashicon.components-checkbox-control__checked {
svg.components-checkbox-control__checked {
fill: #fff;
cursor: pointer;
position: absolute;
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/menu-item/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
// Target plugin icons that can have arbitrary classes by using an aggressive selector.
.dashicon,
.components-menu-items__item-icon,
svg.components-menu-items__item-icon,
> span > svg {
margin-right: 5px;
margin-right: 4px;
}

.components-menu-items__item-icon {
Expand Down
7 changes: 6 additions & 1 deletion packages/components/src/menu-items-choice/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* WordPress dependencies
*/
import { check } from '@wordpress/icons';

/**
* Internal dependencies
*/
Expand All @@ -14,7 +19,7 @@ export default function MenuItemsChoice( {
<MenuItem
key={ item.value }
role="menuitemradio"
icon={ isSelected && 'yes' }
icon={ isSelected && check }
isSelected={ isSelected }
shortcut={ item.shortcut }
className="components-menu-items-choice"
Expand Down
4 changes: 0 additions & 4 deletions packages/components/src/menu-items-choice/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@
&.has-icon {
padding-left: 0.5rem;
}

.dashicon {
margin-right: 4px;
}
}
1 change: 1 addition & 0 deletions packages/edit-post/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@wordpress/element": "file:../element",
"@wordpress/hooks": "file:../hooks",
"@wordpress/i18n": "file:../i18n",
"@wordpress/icons": "file:../icons",
"@wordpress/keyboard-shortcuts": "file:../keyboard-shortcuts",
"@wordpress/keycodes": "file:../keycodes",
"@wordpress/media-utils": "file:../media-utils",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { withSelect, withDispatch } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { MenuItem, withSpokenMessages } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { check } from '@wordpress/icons';

function FeatureToggle( { onToggle, isActive, label, info, messageActivated, messageDeactivated, speak } ) {
const speakMessage = () => {
Expand All @@ -22,7 +23,7 @@ function FeatureToggle( { onToggle, isActive, label, info, messageActivated, mes

return (
<MenuItem
icon={ isActive && 'yes' }
icon={ isActive && check }
isSelected={ isActive }
onClick={ flow( onToggle, speakMessage ) }
role="menuitemcheckbox"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { compose } from '@wordpress/compose';
import { withSelect, withDispatch } from '@wordpress/data';
import { withPluginContext } from '@wordpress/plugins';
import { check } from '@wordpress/icons';

/**
* Internal dependencies
Expand All @@ -12,7 +13,7 @@ import PluginMoreMenuItem from '../plugin-more-menu-item';

const PluginSidebarMoreMenuItem = ( { children, icon, isSelected, onClick } ) => (
<PluginMoreMenuItem
icon={ isSelected ? 'yes' : icon }
icon={ isSelected ? check : icon }
isSelected={ isSelected }
role="menuitemcheckbox"
onClick={ onClick }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ exports[`EnableCustomFieldsOption renders a checked checkbox and a confirmation
/>
<svg
aria-hidden="true"
className="dashicon dashicons-yes components-checkbox-control__checked"
className="components-checkbox-control__checked"
focusable="false"
height={20}
height={24}
role="img"
viewBox="0 0 20 20"
width={20}
viewBox="-2 -2 24 24"
width={24}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z"
d="M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2"
/>
</svg>
</span>
Expand Down Expand Up @@ -81,16 +81,16 @@ exports[`EnableCustomFieldsOption renders a checked checkbox when custom fields
/>
<svg
aria-hidden="true"
className="dashicon dashicons-yes components-checkbox-control__checked"
className="components-checkbox-control__checked"
focusable="false"
height={20}
height={24}
role="img"
viewBox="0 0 20 20"
width={20}
viewBox="-2 -2 24 24"
width={24}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z"
d="M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2"
/>
</svg>
</span>
Expand Down
20 changes: 10 additions & 10 deletions storybook/test/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1868,16 +1868,16 @@ exports[`Storyshots Components/CheckboxControl All 1`] = `
/>
<svg
aria-hidden="true"
className="dashicon dashicons-yes components-checkbox-control__checked"
className="components-checkbox-control__checked"
focusable="false"
height={20}
height={24}
role="img"
viewBox="0 0 20 20"
width={20}
viewBox="-2 -2 24 24"
width={24}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z"
d="M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2"
/>
</svg>
</span>
Expand Down Expand Up @@ -1917,16 +1917,16 @@ exports[`Storyshots Components/CheckboxControl Default 1`] = `
/>
<svg
aria-hidden="true"
className="dashicon dashicons-yes components-checkbox-control__checked"
className="components-checkbox-control__checked"
focusable="false"
height={20}
height={24}
role="img"
viewBox="0 0 20 20"
width={20}
viewBox="-2 -2 24 24"
width={24}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z"
d="M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2"
/>
</svg>
</span>
Expand Down