File tree Expand file tree Collapse file tree 18 files changed +205
-128
lines changed Expand file tree Collapse file tree 18 files changed +205
-128
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "extends": "react-app",
3
+ "plugins": ["prettier"],
4
+ "rules": {
5
+ "prettier/prettier": "error"
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "singleQuote": false,
3
+ "trailingComma": "es5"
4
+ }
Original file line number Diff line number Diff line change 12
12
"url" : " https://github.com/deadcoder0904/wip-desktop.git"
13
13
},
14
14
"homepage" : " https://akshaykadam.me/apps/wip-desktop" ,
15
- "version" : " 1.5 .0" ,
15
+ "version" : " 1.6 .0" ,
16
16
"license" : " MIT" ,
17
17
"scripts" : {
18
+ "precommit" : " pretty-quick --staged" ,
18
19
"dev" : " electron-webpack dev" ,
19
20
"compile" : " electron-webpack" ,
20
21
"pack" : " electron-builder --dir" ,
122
123
"electron" : " ^3.0.0-beta.1" ,
123
124
"electron-builder" : " ^20.27.1" ,
124
125
"electron-webpack" : " ^2.1.2" ,
126
+ "eslint-plugin-prettier" : " ^2.6.2" ,
125
127
"file-loader" : " ^1.1.11" ,
128
+ "husky" : " ^0.14.3" ,
129
+ "prettier" : " 1.14.2" ,
130
+ "pretty-quick" : " ^1.6.0" ,
126
131
"webpack" : " ^4.16.5"
127
132
},
128
133
"resolutions" : {
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export const Loading = ({
14
14
type = "spinningBubbles" ,
15
15
color = "#000" ,
16
16
width = 50 ,
17
- height = 50
17
+ height = 50 ,
18
18
} ) => (
19
19
< Container >
20
20
< ReactLoading type = { type } color = { color } width = { width } height = { height } />
Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ class CreateTodoContainer extends React.Component {
52
52
mutate ( {
53
53
variables : {
54
54
body : this . state . input ,
55
- completedAt : status === "DONE" ? new Date ( ) . toISOString ( ) : null
56
- }
55
+ completedAt : status === "DONE" ? new Date ( ) . toISOString ( ) : null ,
56
+ } ,
57
57
} ) ;
58
58
this . _clearInput ( ) ;
59
59
}
@@ -94,24 +94,24 @@ class CreateTodoContainer extends React.Component {
94
94
id : v4 ( ) ,
95
95
body : input ,
96
96
completed_at :
97
- status === "DONE" ? new Date ( ) . toISOString ( ) : null
98
- }
97
+ status === "DONE" ? new Date ( ) . toISOString ( ) : null ,
98
+ } ,
99
99
} }
100
100
update = { ( cache , { data : { createTodo } } ) => {
101
101
const data = cache . readQuery ( {
102
102
query : GET_TODOS_BY_PRODUCT ,
103
- variables : { id, completed : status === "DONE" }
103
+ variables : { id, completed : status === "DONE" } ,
104
104
} ) ;
105
105
const todos = data . product . todos . map ( t => t ) ; // make a shallow copy otherwise error "Object is not extensible" is thrown
106
106
todos . push ( createTodo ) ;
107
107
const newData = {
108
108
...data ,
109
- product : { ...data . product , todos }
109
+ product : { ...data . product , todos } ,
110
110
} ;
111
111
cache . writeQuery ( {
112
112
query : GET_TODOS_BY_PRODUCT ,
113
113
variables : { id, completed : status === "DONE" } ,
114
- data : newData
114
+ data : newData ,
115
115
} ) ;
116
116
} }
117
117
>
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ const StatusContainer = ({ theme }) => (
57
57
const status = "PENDING" ;
58
58
setStatus ( { variables : { status } } ) ;
59
59
state . set ( {
60
- status
60
+ status,
61
61
} ) ;
62
62
} }
63
63
highlight = { status === "PENDING" }
@@ -69,7 +69,7 @@ const StatusContainer = ({ theme }) => (
69
69
const status = "DONE" ;
70
70
setStatus ( { variables : { status } } ) ;
71
71
state . set ( {
72
- status
72
+ status,
73
73
} ) ;
74
74
} }
75
75
highlight = { status === "DONE" }
Original file line number Diff line number Diff line change @@ -138,17 +138,17 @@ class MainContainer extends React.Component {
138
138
__typename : "Todo" ,
139
139
id : todo . id ,
140
140
body : todo . body ,
141
- completed_at
142
- }
141
+ completed_at,
142
+ } ,
143
143
} }
144
144
update = { ( cache , { data } ) => {
145
145
// remove todo item from current status ,i.e, PENDING or DONE
146
146
const cacheData1 = cache . readQuery ( {
147
147
query : GET_TODOS_BY_PRODUCT ,
148
148
variables : {
149
149
id : productId ,
150
- completed
151
- }
150
+ completed,
151
+ } ,
152
152
} ) ;
153
153
154
154
const todos1 = cacheData1 . product . todos . filter (
@@ -159,26 +159,26 @@ class MainContainer extends React.Component {
159
159
...cacheData1 ,
160
160
product : {
161
161
...cacheData1 . product ,
162
- todos : todos1
163
- }
162
+ todos : todos1 ,
163
+ } ,
164
164
} ;
165
165
166
166
cache . writeQuery ( {
167
167
query : GET_TODOS_BY_PRODUCT ,
168
168
variables : {
169
169
id : productId ,
170
- completed
170
+ completed,
171
171
} ,
172
- data : newData1
172
+ data : newData1 ,
173
173
} ) ;
174
174
175
175
// add todo item to current status ,i.e, PENDING or DONE
176
176
const cacheData2 = cache . readQuery ( {
177
177
query : GET_TODOS_BY_PRODUCT ,
178
178
variables : {
179
179
id : productId ,
180
- completed : status !== "DONE"
181
- }
180
+ completed : status !== "DONE" ,
181
+ } ,
182
182
} ) ;
183
183
184
184
const todos2 = cacheData2 . product . todos . map (
@@ -191,23 +191,23 @@ class MainContainer extends React.Component {
191
191
: "completeTodo"
192
192
] ,
193
193
id : todo . id ,
194
- completed_at
194
+ completed_at,
195
195
} ) ;
196
196
const newData2 = {
197
197
...cacheData2 ,
198
198
product : {
199
199
...cacheData2 . product ,
200
- todos : todos2
201
- }
200
+ todos : todos2 ,
201
+ } ,
202
202
} ;
203
203
204
204
cache . writeQuery ( {
205
205
query : GET_TODOS_BY_PRODUCT ,
206
206
variables : {
207
207
id : productId ,
208
- completed : status !== "DONE"
208
+ completed : status !== "DONE" ,
209
209
} ,
210
- data : newData2
210
+ data : newData2 ,
211
211
} ) ;
212
212
} }
213
213
>
Original file line number Diff line number Diff line change @@ -102,11 +102,11 @@ class ProductsContainer extends React.Component {
102
102
const selectedProduct = {
103
103
id : product . id ,
104
104
name : product . name ,
105
- __typename : "Product"
105
+ __typename : "Product" ,
106
106
} ;
107
107
state . set ( { selectedProduct } ) ;
108
108
mutate ( {
109
- variables : selectedProduct
109
+ variables : selectedProduct ,
110
110
} ) ;
111
111
} }
112
112
>
Original file line number Diff line number Diff line change @@ -27,13 +27,13 @@ const modeObject = {
27
27
DARK : {
28
28
src : LIGHT_MOON ,
29
29
alt : "Enable Light mode" ,
30
- pressed : "false"
30
+ pressed : "false" ,
31
31
} ,
32
32
LIGHT : {
33
33
src : DARK_MOON ,
34
34
alt : "Enable Dark mode" ,
35
- pressed : "true"
36
- }
35
+ pressed : "true" ,
36
+ } ,
37
37
} ;
38
38
39
39
const MoonContainer = ( { theme } ) => (
Original file line number Diff line number Diff line change @@ -25,5 +25,5 @@ export {
25
25
Minimize ,
26
26
MinimizePressed ,
27
27
Maximize ,
28
- MaximizePressed
28
+ MaximizePressed ,
29
29
} ;
You can’t perform that action at this time.
0 commit comments