Skip to content

Commit ccb1c28

Browse files
committed
Update style & v1.0.10
1 parent 017c2bd commit ccb1c28

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

src/modules/tasks/TaskStore.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { autorun, computed, makeAutoObservable, toJS } from 'mobx';
1+
import { autorun, computed, makeAutoObservable } from 'mobx';
22
import { v4 as uuid } from 'uuid';
33
import TaskService from './TaskService';
44
import TaskModel, { ITimeRangeModel } from './models/TaskModel';
@@ -172,7 +172,6 @@ export default class TaskStore {
172172
restore() {
173173
this.tasks = this.tasksService.getAll();
174174
this.suggestions = findSuggestionsByProject(this.tasks);
175-
console.log(toJS(this.suggestions));
176175
this.findAndSetActiveTask();
177176
this.setupReminder(this.activeTask);
178177
}

src/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-
"version": "1.0.9",
4+
"version": "1.0.10",
55
"description": "Start and stop time, jump between tasks, and add details on how time was spent.",
66
"main": "./main.prod.js",
77
"author": {

src/screens/projects/components/CreateTask/Suggestions/Suggestion.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { FC, useCallback } from 'react';
22
import { Button } from 'antd';
33
import { observer } from 'mobx-react';
4+
import { createUseStyles } from 'react-jss';
45

56
import { createTaskStore } from '../store/CreateTaskStore';
67

@@ -9,13 +10,16 @@ type Props = {
910
};
1011

1112
const SuggestionComp: FC<Props> = ({ text }: Props) => {
13+
const $ = useStyle();
14+
1215
const handleApplySuggestion = useCallback(
1316
() => createTaskStore.applySuggestion(text),
1417
[text]
1518
);
1619

1720
return (
1821
<Button
22+
className={$.suggestion}
1923
type="primary"
2024
shape="round"
2125
// icon={}
@@ -28,3 +32,13 @@ const SuggestionComp: FC<Props> = ({ text }: Props) => {
2832
};
2933

3034
export default observer(SuggestionComp);
35+
36+
const useStyle = createUseStyles({
37+
suggestion: {
38+
'& span': {
39+
maxWidth: 200,
40+
overflow: 'hidden',
41+
textOverflow: 'ellipsis',
42+
},
43+
},
44+
});
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
import React, { FC, useMemo } from 'react';
22
import { observer } from 'mobx-react';
3+
import { createUseStyles } from 'react-jss';
34

45
import rootStore from '../../../../../modules/RootStore';
56
import Suggestion from './Suggestion';
67

78
const Suggestions: FC = () => {
9+
const $ = useStyle();
10+
811
const suggestions = useMemo(
912
() => rootStore.tasksStore.suggestionsForProject,
1013
[]
1114
).get();
1215

1316
return (
14-
<>
17+
<div className={$.suggestions}>
1518
{suggestions.map((suggestion) => (
1619
<Suggestion key={suggestion.text} text={suggestion.text} />
1720
))}
18-
</>
21+
</div>
1922
);
2023
};
2124

2225
export default observer(Suggestions);
26+
27+
const useStyle = createUseStyles({
28+
suggestions: {
29+
display: 'flex',
30+
flexWrap: 'nowrap',
31+
overflowX: 'auto',
32+
gap: 8,
33+
marginBottom: 8,
34+
},
35+
});

0 commit comments

Comments
 (0)