1- import React , { FC , memo , useMemo } from 'react' ;
2- import { Chart } from 'react-google-charts' ;
3- import { createUseStyles } from 'react-jss' ;
1+ import React , { FC , memo , useMemo } from 'react' ;
2+ import { Chart } from 'react-google-charts' ;
3+ import { createUseStyles } from 'react-jss' ;
44
55import rootStore from '../../modules/RootStore' ;
6- import { getTimeItems } from '../../helpers/TaskHelper' ;
6+ import { getTimeItems } from '../../helpers/TaskHelper' ;
77
8- const { tasksStore} = rootStore ;
8+ const { tasksStore } = rootStore ;
99
1010const columns = [
11- { type : 'string' , id : 'Task' } ,
12- { type : 'date' , id : 'Start' } ,
13- { type : 'date' , id : 'End' } ,
11+ { type : 'string' , id : 'Task' } ,
12+ { type : 'date' , id : 'Start' } ,
13+ { type : 'date' , id : 'End' } ,
1414] ;
1515
1616const nowDate = new Date ( ) ;
17-
17+ // TODO remove
1818const Timeline : FC = ( ) => {
1919 const classes = useStyles ( ) ;
2020
2121 const data = useMemo ( ( ) => {
2222 const tasks = tasksStore . getTasksByDate ( nowDate ) ;
2323 const filteredTimeItems = getTimeItems ( tasks , nowDate ) ;
24- const items = filteredTimeItems . map ( ( { task, time} ) => [
24+ const items = filteredTimeItems . map ( ( { task, time } ) => [
2525 task . title || '-' ,
2626 time . start || new Date ( ) ,
2727 time . end || new Date ( ) ,
@@ -31,7 +31,12 @@ const Timeline: FC = () => {
3131
3232 return (
3333 < div className = { classes . main } >
34- < Chart style = { { flex : 1 } } chartType = "Timeline" data = { data } height = '100%' />
34+ < Chart
35+ style = { { flex : 1 } }
36+ chartType = "Timeline"
37+ data = { data }
38+ height = "100%"
39+ />
3540 </ div >
3641 ) ;
3742} ;
0 commit comments