Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/MUIDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ class MUIDataTable extends React.Component {
if (props.options.rowsPerPageOptions) {
this.options.rowsPerPageOptions = props.options.rowsPerPageOptions;
}
if (['scroll', 'stacked'].indexOf(this.options.responsive) === -1) {
console.error('Invalid option value for responsive. Please use string option: stacked | scroll');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

}
}

validateOptions(options) {
Expand Down
10 changes: 3 additions & 7 deletions src/components/TableToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import PrintIcon from '@material-ui/icons/Print';
import ViewColumnIcon from '@material-ui/icons/ViewColumn';
import FilterIcon from '@material-ui/icons/FilterList';
import ReactToPrint from 'react-to-print';
import styled from '../styled';
import { withStyles } from '@material-ui/core/styles';
import { createCSVDownload } from '../utils';

export const defaultToolbarStyles = (theme, props) => ({
export const defaultToolbarStyles = theme => ({
root: {},
left: {
flex: '1 1 auto',
Expand All @@ -43,10 +43,6 @@ export const defaultToolbarStyles = (theme, props) => ({
marginTop: '10px',
marginRight: '8px',
},
...(props.options.responsive ? { ...responsiveToolbarStyles(theme) } : {}),
});

export const responsiveToolbarStyles = theme => ({
[theme.breakpoints.down('sm')]: {
titleRoot: {},
titleText: {
Expand Down Expand Up @@ -315,4 +311,4 @@ class TableToolbar extends React.Component {
}
}

export default styled(TableToolbar)(defaultToolbarStyles, { name: 'MUIDataTableToolbar' });
export default withStyles(defaultToolbarStyles, { name: 'MUIDataTableToolbar' })(TableToolbar);
53 changes: 0 additions & 53 deletions src/styled.js

This file was deleted.

12 changes: 0 additions & 12 deletions test/MUIDataTableToolbar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ describe('<TableToolbar />', function() {
const shallowWrapper = shallow(
<TableToolbar columns={columns} data={data} options={newOptions} setTableAction={setTableAction} />,
)
.dive()
.dive()
.dive();
const instance = shallowWrapper.instance();
instance.setActiveIcon('search');
Expand All @@ -144,8 +142,6 @@ describe('<TableToolbar />', function() {
const shallowWrapper = shallow(
<TableToolbar columns={columns} data={data} options={options} setTableAction={setTableAction} />,
)
.dive()
.dive()
.dive();
const instance = shallowWrapper.instance();

Expand All @@ -167,8 +163,6 @@ describe('<TableToolbar />', function() {
setTableAction={setTableAction}
/>,
)
.dive()
.dive()
.dive();
const instance = shallowWrapper.instance();

Expand All @@ -195,8 +189,6 @@ describe('<TableToolbar />', function() {
const shallowWrapper = shallow(
<TableToolbar columns={columns} data={data} options={options} setTableAction={setTableAction} />,
)
.dive()
.dive()
.dive();
const instance = shallowWrapper.instance();

Expand All @@ -218,8 +210,6 @@ describe('<TableToolbar />', function() {
/>,
);
const instance = shallowWrapper
.dive()
.dive()
.dive()
.instance();

Expand Down Expand Up @@ -247,8 +237,6 @@ describe('<TableToolbar />', function() {
);

const instance = shallowWrapper
.dive()
.dive()
.dive()
.instance();

Expand Down