Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Tidy up some boolean checks
  • Loading branch information
andrewserong committed Sep 3, 2025
commit 46ad2a2bcb486ccd81cfef672e895125b553414f
22 changes: 8 additions & 14 deletions packages/dataviews/src/dataviews-layouts/grid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function GridItem< Item >( {
showTitle && titleField?.render ? (
<titleField.render item={ item } field={ titleField } />
) : null;
const shouldRenderMedia = showMedia && renderedMediaField;

let mediaA11yProps;
let titleA11yProps;
Expand Down Expand Up @@ -154,7 +155,7 @@ function GridItem< Item >( {
}
aria-posinset={ posinset }
>
{ showMedia && renderedMediaField && (
{ shouldRenderMedia && (
<ItemClickWrapper
item={ item }
isItemClickable={ isItemClickable }
Expand All @@ -166,7 +167,7 @@ function GridItem< Item >( {
{ renderedMediaField }
</ItemClickWrapper>
) }
{ hasBulkActions && showMedia && renderedMediaField && (
{ hasBulkActions && shouldRenderMedia && (
<DataViewsSelectionCheckbox
item={ item }
selection={ selection }
Expand All @@ -176,18 +177,11 @@ function GridItem< Item >( {
disabled={ ! hasBulkAction }
/>
) }
{ ! showTitle &&
showMedia &&
renderedMediaField &&
!! actions?.length && (
<div className="dataviews-view-grid__media-actions">
<ItemActions
item={ item }
actions={ actions }
isCompact
/>
</div>
) }
{ ! showTitle && shouldRenderMedia && !! actions?.length && (
<div className="dataviews-view-grid__media-actions">
<ItemActions item={ item } actions={ actions } isCompact />
</div>
) }
{ showTitle && (
<HStack
justify="space-between"
Expand Down
Loading