Skip to content

Commit

Permalink
Rename state getters
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiomorales committed Jul 15, 2024
1 parent e3976e8 commit 72b3688
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
// contain a caption, and we don't want to trigger the lightbox when the
// caption is clicked.
$p->set_attribute( 'data-wp-on-async--click', 'actions.showLightbox' );
$p->set_attribute( 'data-wp-class--hide', 'state.contentImageHide' );
$p->set_attribute( 'data-wp-class--show', 'state.contentImageShow' );
$p->set_attribute( 'data-wp-class--hide', 'state.isContentHidden' );
$p->set_attribute( 'data-wp-class--show', 'state.isContentVisible' );

$body_content = $p->get_updated_html();

Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/image/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ const { state, actions, callbacks } = store(
const { imageId } = getContext();
return state.metadata[ imageId ].imageButtonTop;
},
get contentImageHide() {
get isContentHidden() {
const ctx = getContext();
return (
state.overlayEnabled && state.currentImageId === ctx.imageId
);
},
get contentImageShow() {
get isContentVisible() {
const ctx = getContext();
return (
! state.overlayEnabled &&
Expand Down

0 comments on commit 72b3688

Please sign in to comment.