Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions src/ui.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';

export const Filter = ({ onChange, placeholder }) => (
export const Filter = ({ onChange = null, placeholder }) => (
<div className="data-table-extensions-filter">
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
<label
Expand All @@ -23,12 +23,8 @@ Filter.propTypes = {
placeholder: PropTypes.string.isRequired,
};

Filter.defaultProps = {
onChange: null,
};

export const Export = props => {
const { className, onDropdown, onClick } = props;
const { className = '', onDropdown = null, onClick = null } = props;
return (
<>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
Expand All @@ -51,21 +47,11 @@ Export.propTypes = {
onClick: PropTypes.func,
};

Export.defaultProps = {
className: '',
onDropdown: null,
onClick: null,
};

export const Print = props => (
export const Print = ({ onClick = null }) => (
// eslint-disable-next-line jsx-a11y/control-has-associated-label
<button type="button" className="print" onClick={() => props.onClick()} />
<button type="button" className="print" onClick={() => onClick()} />
);

Print.propTypes = {
onClick: PropTypes.func,
};

Print.defaultProps = {
onClick: null,
};