1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

Applied prettier to code base

This commit is contained in:
Laurent Cozic
2018-03-09 17:49:35 +00:00
parent e868102c98
commit c4f19465a6
203 changed files with 13395 additions and 7927 deletions

View File

@@ -1,22 +1,24 @@
const React = require('react'); const Component = React.Component;
const { connect } = require('react-redux');
const { ListView, Text, TouchableHighlight, Switch, View, StyleSheet } = require('react-native');
const { Log } = require('lib/log.js');
const { _ } = require('lib/locale.js');
const { Checkbox } = require('lib/components/checkbox.js');
const { NoteItem } = require('lib/components/note-item.js');
const { reg } = require('lib/registry.js');
const Note = require('lib/models/Note.js');
const Setting = require('lib/models/Setting.js');
const { time } = require('lib/time-utils.js');
const { themeStyle } = require('lib/components/global-style.js');
const React = require("react");
const Component = React.Component;
const { connect } = require("react-redux");
const { ListView, Text, TouchableHighlight, Switch, View, StyleSheet } = require("react-native");
const { Log } = require("lib/log.js");
const { _ } = require("lib/locale.js");
const { Checkbox } = require("lib/components/checkbox.js");
const { NoteItem } = require("lib/components/note-item.js");
const { reg } = require("lib/registry.js");
const Note = require("lib/models/Note.js");
const Setting = require("lib/models/Setting.js");
const { time } = require("lib/time-utils.js");
const { themeStyle } = require("lib/components/global-style.js");
class NoteListComponent extends Component {
constructor() {
super();
const ds = new ListView.DataSource({
rowHasChanged: (r1, r2) => { return r1 !== r2; }
rowHasChanged: (r1, r2) => {
return r1 !== r2;
},
});
this.state = {
dataSource: ds,
@@ -50,8 +52,8 @@ class NoteListComponent extends Component {
}
filterNotes(notes) {
const todoFilter = 'all'; //Setting.value('todoFilter');
if (todoFilter == 'all') return notes;
const todoFilter = "all"; //Setting.value('todoFilter');
if (todoFilter == "all") return notes;
const now = time.unixMs();
const maxInterval = 1000 * 60 * 60 * 24;
@@ -61,8 +63,8 @@ class NoteListComponent extends Component {
for (let i = 0; i < notes.length; i++) {
const note = notes[i];
if (note.is_todo) {
if (todoFilter == 'recent' && note.user_updated_time < notRecentTime && !!note.todo_completed) continue;
if (todoFilter == 'nonCompleted' && !!note.todo_completed) continue;
if (todoFilter == "recent" && note.user_updated_time < notRecentTime && !!note.todo_completed) continue;
if (todoFilter == "nonCompleted" && !!note.todo_completed) continue;
}
output.push(note);
}
@@ -92,30 +94,28 @@ class NoteListComponent extends Component {
if (this.state.dataSource.getRowCount()) {
return (
<ListView
ref={(ref) => this.rootRef_ = ref}
ref={ref => (this.rootRef_ = ref)}
dataSource={this.state.dataSource}
renderRow={(note) => {
return <NoteItem note={note}/>
renderRow={note => {
return <NoteItem note={note} />;
}}
enableEmptySections={true}
/>
);
} else {
const noItemMessage = _('There are currently no notes. Create one by clicking on the (+) button.');
return <Text style={this.styles().noItemMessage} >{noItemMessage}</Text>;
const noItemMessage = _("There are currently no notes. Create one by clicking on the (+) button.");
return <Text style={this.styles().noItemMessage}>{noItemMessage}</Text>;
}
}
}
const NoteList = connect(
(state) => {
return {
items: state.notes,
notesSource: state.notesSource,
theme: state.settings.theme,
noteSelectionEnabled: state.noteSelectionEnabled,
};
}
)(NoteListComponent)
const NoteList = connect(state => {
return {
items: state.notes,
notesSource: state.notesSource,
theme: state.settings.theme,
noteSelectionEnabled: state.noteSelectionEnabled,
};
})(NoteListComponent);
module.exports = { NoteList };
module.exports = { NoteList };