diff --git a/__tests__/components/Pagination.test.jsx b/__tests__/components/Pagination.test.jsx index e11148de25..b2ca6727e8 100644 --- a/__tests__/components/Pagination.test.jsx +++ b/__tests__/components/Pagination.test.jsx @@ -120,8 +120,8 @@ describe('', () => { }); test('submit a new page by typing in input works', () => { - const textInputSelector = '.pf-l-split__item.pf-m-main .pf-c-form-control'; - const submitFormSelector = '.pf-l-split__item.pf-m-main form'; + const textInputSelector = '.awx-pagination__page-input.pf-c-form-control'; + const submitFormSelector = '.awx-pagination__page-input-form'; const onSetPage = jest.fn(); pagination = mount( diff --git a/src/components/Pagination/Pagination.jsx b/src/components/Pagination/Pagination.jsx index 6959fff17c..b2ad94a99c 100644 --- a/src/components/Pagination/Pagination.jsx +++ b/src/components/Pagination/Pagination.jsx @@ -7,11 +7,7 @@ import { DropdownDirection, DropdownItem, DropdownToggle, - Level, - LevelItem, - TextInput, - Split, - SplitItem, + TextInput } from '@patternfly/react-core'; class Pagination extends Component { @@ -120,120 +116,102 @@ class Pagination extends Component { const itemMin = ((page - 1) * page_size) + 1; const itemMax = itemMin + itemCount - 1; - const disabledStyle = { - backgroundColor: '#EDEDED', - border: '1px solid #C2C2CA', - borderRadius: '0px', - color: '#C2C2CA', - }; - return ( {({ i18n }) => (
- - - + Items Per Page + + {page_size} + + )} + > + {opts.map(option => ( + + {option} + + ))} + +
+
+
+ {`Items ${itemMin} - ${itemMax} of ${count}`} +
+ {pageCount !== 1 && ( +
+
+ + - -
- - -
- - {'Page '} - - {' of '} - {pageCount} - -
-
- -
- - -
-
- - - + + +
+
+ + {'Page '} + + {' of '} + {pageCount} + +
+
+ + +
+
+ )} + )}
diff --git a/src/components/Pagination/styles.scss b/src/components/Pagination/styles.scss index 3374ad45b6..76d5af9d14 100644 --- a/src/components/Pagination/styles.scss +++ b/src/components/Pagination/styles.scss @@ -1,39 +1,84 @@ .awx-pagination { --awx-pagination--BackgroundColor: var(--pf-global--BackgroundColor--light-100); - --awx-pagination--BorderColor: var(--pf-global--Color--light-200); - --awx-pagination--BorderWidth: var(--pf-global--BorderWidth--sm); + --awx-pagination--BorderColor: var(--pf-global--BackgroundColor--light-300); + --awx-pagination--disabled-BackgroundColor: #EDEDED; + --awx-pagination--disabled-Color: #C2C2CA; - border: var(--awx-pagination--BorderWidth) solid var(--awx-pagination--BorderColor); + border-top: 1px solid var(--awx-pagination--BorderColor); background-color: var(--awx-pagination--BackgroundColor); - padding-left: 20px; - padding-right: 20px; - padding-top: 20px; - height: 70px; + height: 55px; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 20px; + font-size: 14px; + font-weight: bold; --pf-global--target-size--MinHeight: 30px; --pf-global--target-size--MinWidth: 30px; --pf-global--FontSize--md: 14px; - .pf-c-input-group button { - width: 30px; - height: 30px; - padding: 0px; + .awx-pagination__page-size-selection { + // font-weight: normal; } - .pf-c-dropdown button { - width: 55px; - height: 30px; - padding-left: 10px; - padding-right: 10px; - margin: 0px; - margin-right: 10px; - text-align: left; + .awx-pagination__page-size-selection .pf-c-dropdown__toggle { + font-weight: bold; + margin-left: 10px; + } - .pf-c-dropdown__toggle-icon { - margin: 0px; - margin-top: 2px; - padding: 0px; - float: right; - } + .awx-pagination__counts { + display: flex; + align-items: center; + margin-right: -20px; + } + + .awx-pagination__item-count { + margin-right: 20px; + } + + .awx-pagination__page-count { + margin-left: -10px; + display: flex; + align-items: center; + } + + .awx-pagination__page-input-form { + display: flex; + align-items: center; + margin: 0 10px; + white-space: nowrap; + } + + .awx-pagination__page-input { + width: 35px; + margin: 0 10px; + font-weight: bold; + } + + .awx-pagination__page-button { + width: 55px; + height: 55px; + } + + .pf-c-input-group .awx-pagination__page-button, + .pf-c-input-group .awx-pagination__page-button:after { + border: 0; + border-radius: 0; + } + + .pf-c-input-group .pf-c-button { + border-left: 1px solid var(--awx-pagination--BorderColor); + } + + .pf-c-input-group { + border-right: 1px solid var(--awx-pagination--BorderColor); + height: 56px; + } + + .pf-c-input-group .pf-c-button.pf-m-disabled { + border: 1px solid var(--awx-pagination--BorderColor); + background-color: var(--awx-pagination--disabled-BackgroundColor); + color: var(--awx-pagination--disabled-Color); } }