2018-03-18 01:51:15 +02:00
|
|
|
const React = require('react');
|
|
|
|
const { connect } = require('react-redux');
|
|
|
|
const { time } = require('lib/time-utils.js');
|
2020-06-10 23:08:59 +02:00
|
|
|
const { themeStyle } = require('lib/theme');
|
2018-03-18 01:51:15 +02:00
|
|
|
|
|
|
|
class NoteStatusBarComponent extends React.Component {
|
|
|
|
style() {
|
2020-09-15 15:01:07 +02:00
|
|
|
const theme = themeStyle(this.props.themeId);
|
2018-03-18 01:51:15 +02:00
|
|
|
|
2020-03-14 01:46:14 +02:00
|
|
|
const style = {
|
2018-03-18 01:51:15 +02:00
|
|
|
root: Object.assign({}, theme.textStyle, {
|
|
|
|
backgroundColor: theme.backgroundColor,
|
|
|
|
color: theme.colorFaded,
|
|
|
|
}),
|
|
|
|
};
|
|
|
|
|
|
|
|
return style;
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const note = this.props.note;
|
2019-07-29 14:13:23 +02:00
|
|
|
return <div style={this.style().root}>{time.formatMsToLocal(note.user_updated_time)}</div>;
|
2018-03-18 01:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-21 10:14:33 +02:00
|
|
|
const mapStateToProps = state => {
|
2018-03-18 01:51:15 +02:00
|
|
|
return {
|
|
|
|
// notes: state.notes,
|
|
|
|
// folders: state.folders,
|
|
|
|
// selectedNoteIds: state.selectedNoteIds,
|
2020-09-15 15:01:07 +02:00
|
|
|
themeId: state.settings.theme,
|
2018-03-18 01:51:15 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const NoteStatusBar = connect(mapStateToProps)(NoteStatusBarComponent);
|
|
|
|
|
2019-07-29 14:13:23 +02:00
|
|
|
module.exports = { NoteStatusBar };
|