Skip to content

Commit b1e4d0e

Browse files
committed
Up version & small fix
1 parent 02a1f1b commit b1e4d0e

File tree

4 files changed

+21
-22
lines changed

4 files changed

+21
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "time-tracker",
33
"productName": "TimeTracker",
4-
"description": "Start and stop time, jump between tasks, and add details on how time was spent.",
4+
"description": "Todo list with stopwatch on each task",
55
"scripts": {
66
"build": "concurrently \"yarn build:main\" \"yarn build:renderer\"",
77
"build-dll": "cross-env NODE_ENV=development webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.babel.js",

src/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "time-tracker",
33
"productName": "TimeTracker",
4-
"version": "1.0.9",
5-
"description": "Start and stop time, jump between tasks, and add details on how time was spent.",
4+
"version": "1.0.10",
5+
"description": "Todo list with stopwatch on each task",
66
"main": "./main.prod.js",
77
"author": {
88
"name": "Dmitry Yadrikhinsky",
Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
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

55
import 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

1010
const 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

1616
const nowDate = new Date();
1717

1818
const Timeline: FC = () => {
1919
const classes = useStyles();
2020

21-
const tasks = useMemo(() => tasksStore.getTasksByDate(nowDate), []);
22-
const filteredTimeItems = useMemo(() => getTimeItems(tasks, nowDate), [
23-
tasks,
24-
]);
25-
2621
const data = useMemo(() => {
27-
const items = filteredTimeItems.map(({ task, time }) => [
28-
task.title,
29-
time.start,
22+
const tasks = tasksStore.getTasksByDate(nowDate);
23+
const filteredTimeItems = getTimeItems(tasks, nowDate);
24+
const items = filteredTimeItems.map(({task, time}) => [
25+
task.title || '-',
26+
time.start || new Date(),
3027
time.end || new Date(),
3128
]);
3229
return [columns, ...items];
33-
}, [filteredTimeItems]);
30+
}, []);
3431

3532
return (
3633
<div className={classes.main}>
37-
<Chart chartType="Timeline" data={data} height="100%" />;
34+
<Chart style={{flex: 1}} chartType="Timeline" data={data} height='100%'/>
3835
</div>
3936
);
4037
};
@@ -44,5 +41,7 @@ export default memo(Timeline);
4441
const useStyles = createUseStyles({
4542
main: {
4643
padding: 10,
44+
display: 'flex',
45+
height: '100%',
4746
},
4847
});

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9998,7 +9998,7 @@ react-dom@^17.0.1:
99989998
object-assign "^4.1.1"
99999999
scheduler "^0.20.1"
1000010000

10001-
react-google-charts@^4.0.0:
10001+
react-google-charts@4.0.0:
1000210002
version "4.0.0"
1000310003
resolved "https://registry.yarnpkg.com/react-google-charts/-/react-google-charts-4.0.0.tgz#f648e4fe8ac8a1f47542c2cac040df6afb21e2d6"
1000410004
integrity sha512-9OG0EkBb9JerKEPQYdhmAXnhGLzOdOHOPS9j7l+P1a3z1kcmq9mGDa7PUoX/VQUY4IjZl2/81nsO4o+1cuYsuw==

0 commit comments

Comments
 (0)