Skip to content

Commit b65fdf6

Browse files
committed
refactor MessageTimestamp, as it was missing a PropTypes def for ts
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 22c024c commit b65fdf6

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
Copyright 2015, 2016 OpenMarket Ltd
3+
Copyright 2018 Michael Telatynski <7t3chguy@gmail.com>
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -14,24 +15,22 @@ See the License for the specific language governing permissions and
1415
limitations under the License.
1516
*/
1617

17-
'use strict';
18-
1918
import React from 'react';
19+
import PropTypes from 'prop-types';
2020
import {formatFullDate, formatTime} from 'matrix-react-sdk/lib/DateUtils';
2121

22-
module.exports = React.createClass({
23-
displayName: 'MessageTimestamp',
24-
25-
propTypes: {
26-
showTwelveHour: React.PropTypes.bool,
27-
},
22+
export class MessageTimestamp extends React.Component {
23+
static propTypes = {
24+
ts: PropTypes.number.isRequired,
25+
showTwelveHour: PropTypes.bool,
26+
};
2827

29-
render: function() {
28+
render() {
3029
const date = new Date(this.props.ts);
3130
return (
32-
<span className="mx_MessageTimestamp" title={ formatFullDate(date, this.props.showTwelveHour) }>
31+
<span className="mx_MessageTimestamp" title={formatFullDate(date, this.props.showTwelveHour)}>
3332
{ formatTime(date, this.props.showTwelveHour) }
3433
</span>
3534
);
36-
},
37-
});
35+
}
36+
}

0 commit comments

Comments
 (0)