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

Fix: Dataviews remove primary field concept from some classes. #67689

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
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the name of the variable here clickablePrimaryItemProps.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it was updated 👍

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
Loading