RelativeDateCell PureComponent
This commit is contained in:
parent
4d389ae5ce
commit
22778091f9
|
@ -1,11 +1,16 @@
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import formatDateTime from 'Utilities/Date/formatDateTime';
|
import formatDateTime from 'Utilities/Date/formatDateTime';
|
||||||
import getRelativeDate from 'Utilities/Date/getRelativeDate';
|
import getRelativeDate from 'Utilities/Date/getRelativeDate';
|
||||||
import TableRowCell from './TableRowCell';
|
import TableRowCell from './TableRowCell';
|
||||||
import styles from './RelativeDateCell.css';
|
import styles from './RelativeDateCell.css';
|
||||||
|
|
||||||
function RelativeDateCell(props) {
|
class RelativeDateCell extends PureComponent {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render
|
||||||
|
|
||||||
|
render() {
|
||||||
const {
|
const {
|
||||||
className,
|
className,
|
||||||
date,
|
date,
|
||||||
|
@ -17,7 +22,7 @@ function RelativeDateCell(props) {
|
||||||
component: Component,
|
component: Component,
|
||||||
dispatch,
|
dispatch,
|
||||||
...otherProps
|
...otherProps
|
||||||
} = props;
|
} = this.props;
|
||||||
|
|
||||||
if (!date) {
|
if (!date) {
|
||||||
return (
|
return (
|
||||||
|
@ -38,6 +43,7 @@ function RelativeDateCell(props) {
|
||||||
</Component>
|
</Component>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RelativeDateCell.propTypes = {
|
RelativeDateCell.propTypes = {
|
||||||
className: PropTypes.string.isRequired,
|
className: PropTypes.string.isRequired,
|
||||||
|
|
Loading…
Reference in New Issue