Skip to content

Commit

Permalink
Fix: Dataviews remove primary field concept from some classes. (WordP…
Browse files Browse the repository at this point in the history
…ress#67689)

Co-authored-by: jorgefilipecosta <[email protected]>
Co-authored-by: youknowriad <[email protected]>
  • Loading branch information
3 people authored and yogeshbhutkar committed Dec 18, 2024
1 parent b4e2222 commit 62a6538
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 3 additions & 5 deletions packages/dataviews/src/dataviews-layouts/grid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ function GridItem< Item >( {
className: 'dataviews-view-grid__media',
} );

const clickablePrimaryItemProps = getClickableItemProps( {
const clickableTitleItemProps = getClickableItemProps( {
item,
isItemClickable,
onClickItem,
className: 'dataviews-view-grid__primary-field dataviews-title-field',
className: 'dataviews-view-grid__title-field dataviews-title-field',
} );

return (
Expand Down Expand Up @@ -128,9 +128,7 @@ function GridItem< Item >( {
justify="space-between"
className="dataviews-view-grid__title-actions"
>
<div { ...clickablePrimaryItemProps }>
{ renderedTitleField }
</div>
<div { ...clickableTitleItemProps }>{ renderedTitleField }</div>
<ItemActions item={ item } actions={ actions } isCompact />
</HStack>
<VStack spacing={ 1 }>
Expand Down
2 changes: 1 addition & 1 deletion packages/dataviews/src/dataviews-layouts/grid/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
padding: $grid-unit-10 0 $grid-unit-05;
}

.dataviews-view-grid__primary-field {
.dataviews-view-grid__title-field {
min-height: $grid-unit-30; // Preserve layout when there is no ellipsis button
display: flex;
align-items: center;
Expand Down
8 changes: 4 additions & 4 deletions packages/dataviews/src/dataviews-layouts/list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ul.dataviews-view-list {
}

&:not(.is-selected) {
.dataviews-view-list__primary-field {
.dataviews-view-list__title-field {
color: $gray-900;
}
&:hover,
Expand All @@ -59,7 +59,7 @@ ul.dataviews-view-list {
color: var(--wp-admin-theme-color);
background-color: #f8f8f8;

.dataviews-view-list__primary-field,
.dataviews-view-list__title-field,
.dataviews-view-list__fields {
color: var(--wp-admin-theme-color);
}
Expand All @@ -74,7 +74,7 @@ ul.dataviews-view-list {
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.04);
color: $gray-900;

.dataviews-view-list__primary-field,
.dataviews-view-list__title-field,
.dataviews-view-list__fields {
color: var(--wp-admin-theme-color);
}
Expand Down Expand Up @@ -106,7 +106,7 @@ ul.dataviews-view-list {
}
}
}
.dataviews-view-list__primary-field {
.dataviews-view-list__title-field {
flex: 1;
min-height: $grid-unit-30;
line-height: $grid-unit-30;
Expand Down

0 comments on commit 62a6538

Please sign in to comment.