Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -1,48 +1,7 @@
// @flow
import React from 'react';
import type { ElementType, Node } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = (theme: Object) => ({
root: {
fontSize: theme.typography.pxToRem(12),
color: theme.palette.text.secondary,
},
});
type ProvidedProps = {
classes: Object,
component: ElementType,
};
export type Props = {
/**
* The content of the component, normally `TableRow`.
*/
children?: Node,
/**
* Useful to extend the style applied to components.
*/
classes?: Object,
/**
* @ignore
*/
className?: string,
/**
* The component used for the root node.
* Either a string to use a DOM element or a component.
*/
component?: ElementType,
};
class TableFooter extends React.Component<ProvidedProps & Props> {
static defaultProps = {
component: 'tfoot',
};
class TableFooter extends React.Component {
getChildContext() {
// eslint-disable-line class-methods-use-this
return {
@@ -53,24 +12,30 @@ class TableFooter extends React.Component<ProvidedProps & Props> {
}
render() {
const {
classes,
className: classNameProp,
children,
component: ComponentProp,
...other
} = this.props;
const { component: Component, ...other } = this.props;
return (
<ComponentProp className={classNames(classes.root, classNameProp)} {...other}>
{children}
</ComponentProp>
);
return <Component {...other} />;
}
}
TableFooter.propTypes = {
/**
* The content of the component, normally `TableRow`.
*/
children: PropTypes.node,
/**
* The component used for the root node.
* Either a string to use a DOM element or a component.
*/
component: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
};
TableFooter.defaultProps = {
component: 'tfoot',
};
TableFooter.childContextTypes = {
table: PropTypes.object,
};
export default withStyles(styles, { name: 'MuiTableFooter' })(TableFooter);
export default TableFooter;