Skip to content

Commit

Permalink
[Data views]: Update icons and design tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Oct 16, 2023
1 parent 5a04a2b commit a6793a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
21 changes: 9 additions & 12 deletions packages/edit-site/src/components/dataviews/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { sprintf, __, _x, _n } from '@wordpress/i18n';
import { chevronRight, chevronLeft, previous, next } from '@wordpress/icons';

const PAGE_SIZE_VALUES = [ 5, 20, 50 ];
function PageSizeControl( { view, onChangeView } ) {
Expand Down Expand Up @@ -78,19 +79,17 @@ function Pagination( {
onClick={ () => onChangeView( { ...view, page: 0 } ) }
disabled={ view.page === 0 }
aria-label={ __( 'First page' ) }
>
«
</Button>
icon={ previous }
/>
<Button
variant="tertiary"
onClick={ () =>
onChangeView( { ...view, page: view.page - 1 } )
}
disabled={ view.page === 0 }
aria-label={ __( 'Previous page' ) }
>
</Button>
icon={ chevronLeft }
/>
<HStack
justify="flex-start"
expanded={ false }
Expand Down Expand Up @@ -132,19 +131,17 @@ function Pagination( {
}
disabled={ view.page >= totalPages - 1 }
aria-label={ __( 'Next page' ) }
>
</Button>
icon={ chevronRight }
/>
<Button
variant="tertiary"
onClick={ () =>
onChangeView( { ...view, page: totalPages - 1 } )
}
disabled={ view.page >= totalPages - 1 }
aria-label={ __( 'Last page' ) }
>
»
</Button>
icon={ next }
/>
</HStack>
) }
<PageSizeControl view={ view } onChangeView={ onChangeView } />
Expand Down
6 changes: 6 additions & 0 deletions packages/edit-site/src/components/dataviews/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
padding: $grid-unit-40;
}

.dataviews-pagination {
position: sticky;
bottom: $grid-unit-20;
background: $white;
}

.dataviews-list-view {
width: 100%;
text-indent: 0;
Expand Down

0 comments on commit a6793a7

Please sign in to comment.