File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
src/screens/projects/components/TaskControl Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ .task-control {
2+ color : white ;
3+ // line-height: ;
4+ }
Original file line number Diff line number Diff line change 1+ import React , { useMemo } from 'react' ;
2+ import { observer } from 'mobx-react' ;
3+
4+ import './TaskControl.less' ;
5+
6+ import rootStore from '../../../../services/RootStore' ;
7+ import { useTaskDuration } from '../../../../hooks/TaskHooks' ;
8+
9+ const { tasksStore, projectStore } = rootStore ;
10+
11+ export default observer ( function TaskControl ( ) {
12+ const activeTask = tasksStore . activeTask ;
13+ const duration = useTaskDuration ( activeTask ) ;
14+
15+ const project = useMemo ( ( ) => {
16+ return projectStore . get ( activeTask ?. projectId || '' ) ;
17+ } , [ activeTask ] ) ;
18+
19+ if ( activeTask ) {
20+ return (
21+ < div className = "task-control" >
22+ < div > { project ?. title } </ div >
23+ < div > { activeTask . title } </ div >
24+ { duration }
25+ </ div >
26+ ) ;
27+ }
28+ return < div className = "task-control" > No active tasks</ div > ;
29+ } ) ;
You can’t perform that action at this time.
0 commit comments