Skip to content

Commit

Permalink
Move confim defaults into DefaultProps and add PropTypes.
Browse files Browse the repository at this point in the history
  • Loading branch information
macklin-10x committed Oct 3, 2019
1 parent a694c05 commit 8fe5522
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const useStyles = makeStyles(theme => ({
const BulkDeleteWithConfirmButton = ({
basePath,
classes: classesOverride,
confirmTitle = 'ra.message.bulk_delete_title',
confirmContent = 'ra.message.bulk_delete_content',
confirmTitle,
confirmContent,
crudDeleteMany,
icon,
label,
Expand Down Expand Up @@ -129,13 +129,17 @@ const BulkDeleteWithConfirmButton = ({
BulkDeleteWithConfirmButton.propTypes = {
basePath: PropTypes.string,
classes: PropTypes.object,
confirmTitle: PropTypes.string,
confirmContent: PropTypes.string,
label: PropTypes.string,
resource: PropTypes.string.isRequired,
selectedIds: PropTypes.arrayOf(PropTypes.any).isRequired,
icon: PropTypes.element,
};

BulkDeleteWithConfirmButton.defaultProps = {
confirmTitle: 'ra.message.bulk_delete_title',
confirmContent: 'ra.message.bulk_delete_content',
label: 'ra.action.delete',
icon: <ActionDelete />,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ DeleteWithConfirmButton.propTypes = {
basePath: PropTypes.string,
classes: PropTypes.object,
className: PropTypes.string,
confirmTitle: PropTypes.string,
confirmContent: PropTypes.string,
label: PropTypes.string,
record: PropTypes.object,
redirect: PropTypes.oneOfType([
Expand Down

0 comments on commit 8fe5522

Please sign in to comment.