File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -65,19 +65,24 @@ const useStyles = makeStyles(theme => ({
6565
6666
6767interface CustomToolbarProps {
68- onAdd : ( ) => void
68+ taskType : TaskType ;
69+ onAdd : ( ) => void ;
6970} ;
7071
7172// The actions are appended to the original toolbar actions
7273const CustomToolbar = ( props : CustomToolbarProps ) => {
7374 const classes = useStyles ( ) ;
7475
7576 return (
76- < Tooltip title = "Add Task" >
77- < IconButton className = { classes . add } onClick = { props . onAdd } >
78- < PlusIcon />
79- </ IconButton >
80- </ Tooltip >
77+ < >
78+ { props . taskType === "todo" &&
79+ < Tooltip title = "Add Task" >
80+ < IconButton className = { classes . add } onClick = { props . onAdd } >
81+ < PlusIcon />
82+ </ IconButton >
83+ </ Tooltip >
84+ }
85+ </ >
8186 ) ;
8287} ;
8388
@@ -307,7 +312,7 @@ function TaskList(props: Props) {
307312 print : false ,
308313 download : false ,
309314 customToolbar : ( ) => {
310- return < CustomToolbar onAdd = { props . onAdd } />
315+ return < CustomToolbar taskType = { props . taskType } onAdd = { props . onAdd } />
311316 } ,
312317 customToolbarSelect : ( selectedRows , _ , setSelectedRows ) => {
313318 const ids = selectedRows . data . map ( ( { dataIndex } ) => tasks [ dataIndex ] . id ) ;
You can’t perform that action at this time.
0 commit comments