Skip to content
Permalink
Browse files

Add .editorconfig

  • Loading branch information...
upvalue committed Oct 6, 2018
1 parent 4b8227f commit 39fda0a866ae100bac307694d39626765a8c90f0
Showing with 39 additions and 26 deletions.
  1. +3 −0 .editorconfig
  2. +2 −1 frontend/habits/components/TimeScope.tsx
  3. +15 −8 frontend/journal/state.ts
  4. +19 −17 tslint.json
@@ -0,0 +1,3 @@
[*]
indent_size = 2
indent_style = space
@@ -6,12 +6,13 @@ import { routeForView } from '../main';
import { createCTask } from './Task';
import { PresentScope } from './PresentScope';

interface TimeScopeProps {
export interface TimeScopeProps {
currentProject: number;
currentDate: moment.Moment;
scope: Scope;
filter: FilterState;


/**
* The task name the user most recently interacted with. Used to bolden the task name across
* the whole interface.
@@ -100,31 +100,35 @@ const reducer = (state: JournalState, action: JournalAction): JournalState => {
console.log(state);
switch (action.type) {
case 'VIEW_MONTH':
return {...state,
return {
...state,
route: 'VIEW_MONTH',
date: action.date,
entries: action.entries,
searchResults: undefined,
searchString: undefined,
} as ViewMonth;
case 'VIEW_DAYS':
return {...state,
return {
...state,
route: 'VIEW_DAYS',
date: action.date,
entries: action.entries,
searchResults: undefined,
searchString: undefined,
} as ViewDays;
case 'VIEW_TAG':
return { ...state,
return {
...state,
route: 'VIEW_TAG',
tag: action.tag,
entries: action.entries,
searchResults: undefined,
searchString: undefined,
} as ViewTag;
case 'MOUNT_ENTRIES':
return {...state,
return {
...state,
entries: action.entries,
};
case 'CREATE_ENTRY':
@@ -142,22 +146,25 @@ const reducer = (state: JournalState, action: JournalAction): JournalState => {
// but it probably doesn't matter as
// long as the UI is snappy. Alternative would be building a map of IDs at render-time

return {...state,
return {
...state,
entries: state.entries.slice().map(v => v.ID === action.entry.ID ? action.entry : v),
};
case 'DELETE_ENTRY':
return {...state,
return {
...state,
entries: state.entries.slice().filter(v => v.ID !== action.ID),
};
case 'SEARCH': {
return { ...state,
return {
...state,
entries: action.entries,
searchString: action.string,
searchResults: action.entries.length,
};
}
case 'MOUNT_SIDEBAR':
const nstate = { ...state, sidebar: action.sidebar };
const nstate = { ...state, sidebar: action.sidebar };
nstate.sidebar.mounted = true;
return nstate;
case 'VIEW_NAMED_ENTRY':
@@ -1,19 +1,21 @@
{
"defaultSeverity": "warning",
"extends": [
"tslint-config-airbnb",
"tslint-react"
"defaultSeverity": "warning",
"extends": [
"tslint-config-airbnb",
"tslint-react"
],
"jsRules": {},
"rules": {
"align": [
false
],
"jsRules": {},
"rules": {
"align": [false],
"import-name": false,
"variable-name": false,
"indent": false,
"ter-indent": false,
"no-else-after-return": false,
"jsx-no-multiline-js": false,
"jsx-no-lambda": false
},
"rulesDirectory": []
}
"import-name": false,
"variable-name": false,
"indent": false,
"ter-indent": false,
"no-else-after-return": false,
"jsx-no-multiline-js": false,
"jsx-no-lambda": false
},
"rulesDirectory": []
}

0 comments on commit 39fda0a

Please sign in to comment.
You can’t perform that action at this time.