From 4fb53e09e2c1a6423c0e6a47b94bbfb7a843af3b Mon Sep 17 00:00:00 2001 From: James Koster Date: Wed, 24 Jan 2024 14:29:16 +0000 Subject: [PATCH 1/3] Reduce page selector prominence --- packages/dataviews/src/pagination.js | 57 +++++++++++++--------------- packages/dataviews/src/style.scss | 11 +++++- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/packages/dataviews/src/pagination.js b/packages/dataviews/src/pagination.js index f69d7c7a12e193..41167b09640f98 100644 --- a/packages/dataviews/src/pagination.js +++ b/packages/dataviews/src/pagination.js @@ -6,8 +6,8 @@ import { __experimentalHStack as HStack, SelectControl, } from '@wordpress/components'; -import { createInterpolateElement, memo } from '@wordpress/element'; -import { sprintf, __, _x } from '@wordpress/i18n'; +import { memo } from '@wordpress/element'; +import { sprintf, __ } from '@wordpress/i18n'; import { chevronRight, chevronLeft } from '@wordpress/icons'; const Pagination = memo( function Pagination( { @@ -27,36 +27,33 @@ const Pagination = memo( function Pagination( { justify="end" className="dataviews-pagination" > - - { createInterpolateElement( - sprintf( + + { + const page = i + 1; + return { value: page, label: page }; + } + ) } + onChange={ ( newValue ) => { + onChangeView( { + ...view, + page: +newValue, + } ); + } } + size={ 'compact' } + __nextHasNoMarginBottom + /> + + { sprintf( // translators: %s: Total number of pages. - _x( 'Page of %s', 'paging' ), + 'of %s', totalPages - ), - { - CurrenPageControl: ( - { - const page = i + 1; - return { value: page, label: page }; - } ) } - onChange={ ( newValue ) => { - onChangeView( { - ...view, - page: +newValue, - } ); - } } - size={ 'compact' } - __nextHasNoMarginBottom - /> - ), - } - ) } + ) } +