File tree Expand file tree Collapse file tree 4 files changed +27
-18
lines changed
screens/projects/components/TaskNode Expand file tree Collapse file tree 4 files changed +27
-18
lines changed Original file line number Diff line number Diff line change 1+ export const Features = {
2+ myDay : false ,
3+ } ;
Original file line number Diff line number Diff line change @@ -4,18 +4,21 @@ import ProjectModel, {
44 DEFAULT_PROJECTS ,
55 IJsonProjectItem ,
66} from './models/ProjectModel' ;
7+ import { Features } from '../../config' ;
78
89export default class ProjectFactory extends AbstractFactory {
910 createProjects ( projectItems : IJsonProjectItem [ ] ) : ProjectModel [ ] {
10- const hasMyDay = projectItems . find (
11- ( p ) => p . key === DEFAULT_PROJECT_ID . MyDay
12- ) ;
13- if ( ! hasMyDay ) {
14- const myDayProj = DEFAULT_PROJECTS . find (
11+ if ( Features . myDay ) {
12+ const hasMyDay = projectItems . find (
1513 ( p ) => p . key === DEFAULT_PROJECT_ID . MyDay
1614 ) ;
17- if ( myDayProj ) {
18- projectItems . unshift ( myDayProj ) ;
15+ if ( ! hasMyDay ) {
16+ const myDayProj = DEFAULT_PROJECTS . find (
17+ ( p ) => p . key === DEFAULT_PROJECT_ID . MyDay
18+ ) ;
19+ if ( myDayProj ) {
20+ projectItems . unshift ( myDayProj ) ;
21+ }
1922 }
2023 }
2124
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ export enum DEFAULT_PROJECT_ID {
99}
1010
1111export const DEFAULT_PROJECTS : IJsonProjectItem [ ] = [
12- {
13- key : DEFAULT_PROJECT_ID . MyDay ,
14- title : 'My Day' ,
15- color : colors . yellow . primary || '' ,
16- deletable : false ,
17- expanded : false ,
18- } ,
12+ // {
13+ // key: DEFAULT_PROJECT_ID.MyDay,
14+ // title: 'My Day',
15+ // color: colors.yellow.primary || '',
16+ // deletable: false,
17+ // expanded: false,
18+ // },
1919 {
2020 key : DEFAULT_PROJECT_ID . Inbox ,
2121 title : 'Inbox' ,
@@ -51,7 +51,7 @@ export default class ProjectModel extends AbstractModel
5151
5252 const newProps = {
5353 ...props ,
54- children : props . children ?. map ( ( json ) => new ProjectModel ( json ) )
54+ children : props . children ?. map ( ( json ) => new ProjectModel ( json ) ) ,
5555 } ;
5656
5757 this . load ( newProps ) ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { createUseStyles } from 'react-jss';
1111import TaskModel from '../../../../modules/tasks/models/TaskModel' ;
1212import rootStore from '../../../../modules/RootStore' ;
1313import * as TaskHooks from '../../../../hooks/TaskHooks' ;
14+ import { Features } from '../../../../config' ;
1415
1516const { tasksStore } = rootStore ;
1617
@@ -35,9 +36,11 @@ export default observer(function TaskNode({ task }: TaskNodeProps) {
3536 < span className = { classes . taskTitle } > { task . title } </ span >
3637 < span > { duration } </ span >
3738 < span className = { classes . taskNodeActions } >
38- < EnterOutlined
39- onClick = { preventDefault ( ( ) => tasksStore . addToMyDay ( task ) ) }
40- />
39+ { Features . myDay && (
40+ < EnterOutlined
41+ onClick = { preventDefault ( ( ) => tasksStore . addToMyDay ( task ) ) }
42+ />
43+ ) }
4144 { ! task . active ? (
4245 < CaretRightFilled
4346 onClick = { preventDefault ( ( ) => tasksStore . startTimer ( task ) ) }
You can’t perform that action at this time.
0 commit comments