Skip to content

Commit

Permalink
Added a selection mark
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Jan 11, 2024
1 parent 7320420 commit 3ce5184
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions packages/dataviews/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
background-color: #f8f8f8;
}
}
&.is-selected {
background-color: #f7f8fe;
}
}
thead {
tr {
Expand Down
8 changes: 4 additions & 4 deletions packages/dataviews/src/view-table.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import classNames from 'classnames';
import classnames from 'classnames';

/**
* WordPress dependencies
Expand Down Expand Up @@ -516,7 +516,7 @@ function ViewTable( {
<tbody>
{ hasData &&
usedData.map( ( item, index ) => (
<tr key={ getItemId( item ) }>
<tr key={ getItemId( item ) } className={ classnames({'is-selected': selection.includes( getItemId( item ) || index ) })}>
{ hasBulkActions && (
<td
style={ {
Expand All @@ -525,7 +525,7 @@ function ViewTable( {
} }
>
<SingleSelectionCheckbox
id={ getItemId?.( item ) || index }
id={ getItemId( item ) || index }
item={ item }
selection={ selection }
onSelectionChange={
Expand Down Expand Up @@ -566,7 +566,7 @@ function ViewTable( {
</tbody>
</table>
<div
className={ classNames( {
className={ classnames( {
'dataviews-loading': isLoading,
'dataviews-no-results': ! hasData && ! isLoading,
} ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function useResetTemplateAction() {
return useMemo(
() => ( {
id: 'reset-template',
label: __( 'Reset template' ),
label: __( 'Reset' ),
isPrimary: true,
icon: backup,
isEligible: isTemplateRevertable,
Expand Down Expand Up @@ -111,7 +111,7 @@ export function useResetTemplateAction() {

export const deleteTemplateAction = {
id: 'delete-template',
label: __( 'Delete template' ),
label: __( 'Delete' ),
isPrimary: true,
icon: trash,
isEligible: isTemplateRemovable,
Expand Down

0 comments on commit 3ce5184

Please sign in to comment.