File tree Expand file tree Collapse file tree 2 files changed +7
-15
lines changed
packages/components/src/PageSize Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,7 @@ test('<PageSize/> with defaults', () => {
4040 < PageSize value = { 10 } total = { 1000 } onChange = { onChange } />
4141 )
4242
43- getByText ( 'Display' )
4443 const select = getByDisplayValue ( '10' )
45- getByText ( 'of 1000' )
4644
4745 fireEvent . click ( select )
4846
@@ -65,9 +63,7 @@ test('<PageSize/> with custom options prop', () => {
6563 />
6664 )
6765
68- getByText ( 'Display' )
6966 const select = getByDisplayValue ( '20' )
70- getByText ( 'of 1000' )
7167
7268 fireEvent . click ( select )
7369
Original file line number Diff line number Diff line change 2727import React , { FC } from 'react'
2828import styled from 'styled-components'
2929import { Select } from '../Form'
30- import { Text } from '../Text'
3130
3231export interface PageSizeProps {
3332 className ?: string
@@ -65,30 +64,27 @@ export const PageSizeLayout: FC<PageSizeProps> = ({
6564 total,
6665 className,
6766 onChange,
68- options,
67+ options = defaultPageSizes ,
6968} ) => {
70- options = options || defaultPageSizes
71-
72- const handleOnChange = ( newValue : string ) => {
73- onChange ( Number ( newValue ) )
74- }
69+ const handleOnChange = ( newValue : string ) => onChange ( Number ( newValue ) )
7570
7671 return Math . min ( ...options ) < total ? (
7772 < div className = { className } >
78- < Text > Display</ Text >
73+ Display
7974 < Select
8075 width = "5rem"
81- mx = "medium "
76+ mx = "xsmall "
8277 options = { arrayToSelectOptions ( options ) }
8378 value = { String ( value ) }
8479 onChange = { handleOnChange }
8580 />
86- < Text > of { total } </ Text >
81+ of { total }
8782 </ div >
8883 ) : null
8984}
9085
9186export const PageSize = styled ( PageSizeLayout ) `
92- display: flex;
9387 align-items: center;
88+ display: flex;
89+ font-size: ${ ( { theme } ) => theme . fontSizes . small } ;
9490`
You can’t perform that action at this time.
0 commit comments