Skip to content

Commit

Permalink
Remove redundant property
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Jul 23, 2024
1 parent 5eb1e73 commit dad1fea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

'iconsSections' => $icons_sections,
'icons' => $icons,
'selectedIcon' => $selected_icon,
'selectedIcon' => array( $selected_icon ),
)
);

Expand All @@ -85,11 +85,11 @@

<div class="details clear">
<div id="glyph">
<template data-wp-each--icon="state.selectedIconDetails" data-wp-each-key="state.eachIcon.slug">
<template data-wp-each--icon="state.selectedIcon" data-wp-each-key="state.eachIcon.slug">
<div data-wp-bind--class="state.iconClass"></div>
<div class="info">
<span><strong data-wp-text="state.eachIcon.sectionLabel"></strong></span>
<span class="name"><code data-wp-text="state.selectedIcon"></code></span>
<span class="name"><code data-wp-text="state.selectedIcon.0"></code></span>
<span class="charCode"><code data-wp-text="state.eachIcon.code"></code></span>
<span class="link"><a href='javascript:dashicons.copy( "content: \"\\{{data.attr}}\";", "css" )'><?php _e( 'Copy CSS', 'wporg' ); ?></a></span>
<span class="link"><a href="javascript:dashicons.copy( '{{data.html}}', 'html' )"><?php _e( 'Copy HTML', 'wporg' ); ?></a></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@ const { state } = IAPI.store( 'wporg/dashicons-page', {
get eachIcon() {
return state.icons[ IAPI.getContext().icon ];
},

get selectedIconDetails() {
return state.selectedIcon ? [ state.selectedIcon ] : [];
},
},
actions: {
handleIconClick() {
state.selectedIcon = IAPI.getContext().icon;
state.selectedIcon = [ IAPI.getContext().icon ];
},
},
} );

0 comments on commit dad1fea

Please sign in to comment.