@@ -19,39 +19,39 @@ import { getParameterByName } from "./utils";
1919import CompareComponent from "./components/compare" ;
2020import { DEFAULT_CONTAINER_STYLE , DEFAULT_SEARCHBAR_STYLE } from "./constants" ;
2121
22- const Alert = props => {
22+ const Alert = ( props ) => {
2323 return < MuiAlert elevation = { 6 } variant = "filled" { ...props } /> ;
2424} ;
2525
26- const useStyles = makeStyles ( theme => ( {
26+ const useStyles = makeStyles ( ( theme ) => ( {
2727 button : {
28- margin : theme . spacing ( 1 )
28+ margin : theme . spacing ( 1 ) ,
2929 } ,
3030 textField : {
3131 marginLeft : theme . spacing ( 1 ) ,
3232 marginRight : theme . spacing ( 1 ) ,
33- width : "50ch"
33+ width : "50ch" ,
3434 } ,
3535 searchTextField : {
36- margin : 0
36+ margin : 0 ,
3737 } ,
3838 root : {
3939 display : "flex" ,
4040 flexWrap : "wrap" ,
4141 alignItems : "center" ,
42- width : "100%"
42+ width : "100%" ,
4343 } ,
4444 autocomplete : {
4545 flex : 1 ,
46- paddingTop : "5px"
46+ paddingTop : "5px" ,
4747 } ,
4848 iconButton : {
49- padding : 10
49+ padding : 10 ,
5050 } ,
5151 divider : {
5252 height : 28 ,
53- margin : 4
54- }
53+ margin : 4 ,
54+ } ,
5555} ) ) ;
5656
5757function TabPanel ( props ) {
@@ -77,13 +77,13 @@ function TabPanel(props) {
7777TabPanel . propTypes = {
7878 children : PropTypes . node ,
7979 index : PropTypes . any . isRequired ,
80- value : PropTypes . any . isRequired
80+ value : PropTypes . any . isRequired ,
8181} ;
8282
8383function a11yProps ( index ) {
8484 return {
8585 id : `scrollable-force-tab-${ index } ` ,
86- "aria-controls" : `scrollable-force-tabpanel-${ index } `
86+ "aria-controls" : `scrollable-force-tabpanel-${ index } ` ,
8787 } ;
8888}
8989
@@ -130,8 +130,8 @@ const App = () => {
130130 const classes = useStyles ( ) ;
131131
132132 const showAlert = ( message = "" , type = "success" ) => {
133- if ( typeof ( message === ' object' && type === ' error' ) ) {
134- message = ' Request Error'
133+ if ( typeof ( message === " object" && type === " error" ) ) {
134+ message = " Request Error" ;
135135 }
136136 setMessage ( message ) ;
137137 setAlertType ( type ) ;
@@ -146,7 +146,7 @@ const App = () => {
146146 setOpen ( false ) ;
147147 } ;
148148
149- const updateChart = repo => {
149+ const updateChart = ( repo ) => {
150150 if ( ! contributorRepoList . includes ( repo ) ) {
151151 setContributorRepoList ( [ ...contributorRepoList , repo ] ) ;
152152 }
@@ -156,16 +156,16 @@ const App = () => {
156156 fetch ( `https://contributor-overtime-api.apiseven.com/repos?` , {
157157 method : "GET" ,
158158 headers : {
159- Accept : "application/vnd.github.v3+json"
160- }
159+ Accept : "application/vnd.github.v3+json" ,
160+ } ,
161161 } )
162162 . then ( function ( response ) {
163163 return response . json ( ) ;
164164 } )
165- . then ( data => {
165+ . then ( ( data ) => {
166166 setSearchOption ( data . Repos || [ ] ) ;
167167 } )
168- . catch ( e => {
168+ . catch ( ( e ) => {
169169 console . log ( "e: " , e ) ;
170170 } ) ;
171171 } ;
@@ -188,7 +188,7 @@ const App = () => {
188188 window . parent . postMessage (
189189 {
190190 chartType :
191- value === 0 ? "contributorOverTime" : "contributorMonthlyActivity"
191+ value === 0 ? "contributorOverTime" : "contributorMonthlyActivity" ,
192192 } ,
193193 "*"
194194 ) ;
@@ -213,7 +213,7 @@ const App = () => {
213213 display : "flex" ,
214214 flexDirection : "column" ,
215215 justifyContent : "center" ,
216- alignItems : "center"
216+ alignItems : "center" ,
217217 } }
218218 >
219219 < div style = { searchStyle } >
@@ -231,18 +231,18 @@ const App = () => {
231231 updateChart ( value ) ;
232232 }
233233 } }
234- renderInput = { params => (
234+ renderInput = { ( params ) => (
235235 < TextField
236236 { ...params }
237237 label = "Search Github Repository Name"
238238 margin = "normal"
239239 variant = "outlined"
240240 helperText = "Keep searching to complete the comparison"
241241 className = { classes . searchTextField }
242- onChange = { e => {
242+ onChange = { ( e ) => {
243243 setRepo ( e . target . value ) ;
244244 } }
245- onKeyPress = { ev => {
245+ onKeyPress = { ( ev ) => {
246246 if ( ev . key === "Enter" ) {
247247 updateChart ( repo ) ;
248248 ev . preventDefault ( ) ;
@@ -260,7 +260,7 @@ const App = () => {
260260 < SearchIcon />
261261 </ IconButton >
262262 </ InputAdornment >
263- )
263+ ) ,
264264 } }
265265 />
266266 ) }
@@ -269,12 +269,11 @@ const App = () => {
269269 < div >
270270 < CompareComponent
271271 list = { contributorRepoList }
272- onDelete = { e => {
273- const clonedContributorRepoList = cloneDeep (
274- contributorRepoList
275- ) ;
272+ onDelete = { ( e ) => {
273+ const clonedContributorRepoList =
274+ cloneDeep ( contributorRepoList ) ;
276275 const newContributorRepoList = clonedContributorRepoList . filter (
277- item => item !== e
276+ ( item ) => item !== e
278277 ) ;
279278 setContributorRepoList ( newContributorRepoList ) ;
280279 } }
@@ -288,7 +287,7 @@ const App = () => {
288287 style = { {
289288 display : "flex" ,
290289 justifyContent : "center" ,
291- flexDirection : "column"
290+ flexDirection : "column" ,
292291 } }
293292 > </ div >
294293 </ div >
@@ -299,7 +298,7 @@ const App = () => {
299298 width : "90%" ,
300299 display : "flex" ,
301300 justifyContent : "left" ,
302- padding : "5px"
301+ padding : "5px" ,
303302 } }
304303 >
305304 < Paper color = "default" elevation = { 0 } >
@@ -331,12 +330,12 @@ const App = () => {
331330 < ContirbutorLineChart
332331 repoList = { contributorRepoList }
333332 showAlert = { showAlert }
334- onLoading = { e => {
333+ onLoading = { ( e ) => {
335334 setTabDisabled ( e ) ;
336335 } }
337- onDelete = { e => {
336+ onDelete = { ( e ) => {
338337 setContributorRepoList (
339- contributorRepoList . filter ( item => item !== e )
338+ contributorRepoList . filter ( ( item ) => item !== e )
340339 ) ;
341340 } }
342341 />
@@ -345,12 +344,12 @@ const App = () => {
345344 < ActivityChart
346345 repoList = { contributorRepoList }
347346 showAlert = { showAlert }
348- onLoading = { e => {
347+ onLoading = { ( e ) => {
349348 setTabDisabled ( e ) ;
350349 } }
351- onDelete = { e => {
350+ onDelete = { ( e ) => {
352351 setContributorRepoList (
353- contributorRepoList . filter ( item => item !== e )
352+ contributorRepoList . filter ( ( item ) => item !== e )
354353 ) ;
355354 } }
356355 />
0 commit comments