diff --git a/src/addons/Confirm/Confirm.js b/src/addons/Confirm/Confirm.js index 89c7679521..57a360e6f4 100644 --- a/src/addons/Confirm/Confirm.js +++ b/src/addons/Confirm/Confirm.js @@ -10,9 +10,15 @@ import Modal from '../../modules/Modal' * A Confirm modal gives the user a choice to confirm or cancel an action. * @see Modal */ -const Confirm = React.forwardRef(function (partialProps, ref) { - const props = _.defaults(partialProps, getDefaultProps()) - const { cancelButton, confirmButton, content, header, open, size } = props +const Confirm = React.forwardRef(function (props, ref) { + const { + cancelButton = 'Cancel', + confirmButton = 'OK', + content = 'Are you sure?', + header, + open, + size = 'small', + } = props const rest = getUnhandledProps(Confirm, props) const handleCancel = (e) => { @@ -97,13 +103,4 @@ Confirm.propTypes = { size: PropTypes.oneOf(['mini', 'tiny', 'small', 'large', 'fullscreen']), } -function getDefaultProps() { - return { - cancelButton: 'Cancel', - confirmButton: 'OK', - content: 'Are you sure?', - size: 'small', - } -} - export default Confirm diff --git a/src/addons/Pagination/Pagination.js b/src/addons/Pagination/Pagination.js index 2a0550f4bb..05a8b39c4a 100644 --- a/src/addons/Pagination/Pagination.js +++ b/src/addons/Pagination/Pagination.js @@ -14,14 +14,30 @@ import PaginationItem from './PaginationItem' /** * A component to render a pagination. */ -const Pagination = React.forwardRef(function (partialProps, ref) { - const props = _.defaults(partialProps, getDefaultProps()) +const Pagination = React.forwardRef(function (props, ref) { const { - 'aria-label': ariaLabel, - boundaryRange, + 'aria-label': ariaLabel = 'Pagination Navigation', + boundaryRange = 1, disabled, - ellipsisItem, - siblingRange, + ellipsisItem = '...', + firstItem = { + 'aria-label': 'First item', + content: '«', + }, + lastItem = { + 'aria-label': 'Last item', + content: '»', + }, + nextItem = { + 'aria-label': 'Next item', + content: '⟩', + }, + pageItem = {}, + prevItem = { + 'aria-label': 'Previous item', + content: '⟨', + }, + siblingRange = 1, totalPages, } = props const [activePage, setActivePage] = useAutoControlledValue({ @@ -64,10 +80,18 @@ const Pagination = React.forwardRef(function (partialProps, ref) { }) const rest = getUnhandledProps(Pagination, props) + const paginationItemTypes = { + firstItem, + lastItem, + nextItem, + pageItem, + prevItem, + } + return (