diff --git a/src/App.js b/src/App.js index cfb10c9..43cbd4a 100644 --- a/src/App.js +++ b/src/App.js @@ -47,7 +47,7 @@ function App() { exact path="/tabs" render={() => ( - + )} /> { watched_id, watchers_count, taskDetail, + taskList, setTasks, } = props; diff --git a/src/pages/tasks/TaskKanban.js b/src/pages/tasks/TaskKanban.js index ba1636d..bc40c78 100644 --- a/src/pages/tasks/TaskKanban.js +++ b/src/pages/tasks/TaskKanban.js @@ -20,7 +20,7 @@ import NoResults from "../../assets/no-results.png"; import { useCurrentUser } from "../../contexts/CurrentUserContext"; import { Link } from "react-router-dom/cjs/react-router-dom.min"; -function TaskKanban({ message, filter = "" }) { +function TaskKanban({ message, filter = "", taskList }) { const [tasks, setTasks] = useState({ results: [] }); const [hasLoaded, setHasLoaded] = useState(false); const { pathname } = useLocation(); @@ -93,7 +93,11 @@ function TaskKanban({ message, filter = "" }) { children={tasks.results.map( (task) => task.status === "TO-DO" && ( - + ) )} dataLength={tasks.results.length} @@ -119,7 +123,11 @@ function TaskKanban({ message, filter = "" }) { children={tasks.results.map( (task) => task.status === "IN-PROGRESS" && ( - + ) )} dataLength={tasks.results.length} @@ -145,7 +153,11 @@ function TaskKanban({ message, filter = "" }) { children={tasks.results.map( (task) => task.status === "DONE" && ( - + ) )} dataLength={tasks.results.length} diff --git a/src/pages/tasks/TaskList.js b/src/pages/tasks/TaskList.js index 617ff5d..6e315ba 100644 --- a/src/pages/tasks/TaskList.js +++ b/src/pages/tasks/TaskList.js @@ -18,7 +18,7 @@ import NoResults from "../../assets/no-results.png"; // import ProfileList from "../profiles/ProfileList"; import { useCurrentUser } from "../../contexts/CurrentUserContext"; -function TaskList({ message, filter = "" }) { +function TaskList({ message, filter = "" , taskList}) { const [tasks, setTasks] = useState({ results: [] }); const [hasLoaded, setHasLoaded] = useState(false); const { pathname } = useLocation(); @@ -69,7 +69,11 @@ function TaskList({ message, filter = "" }) { {tasks.results.length ? ( ( - + ))} dataLength={tasks.results.length} loader={} diff --git a/src/pages/tasks/TaskTabs.js b/src/pages/tasks/TaskTabs.js index df2e0b2..20cb504 100644 --- a/src/pages/tasks/TaskTabs.js +++ b/src/pages/tasks/TaskTabs.js @@ -14,9 +14,9 @@ import { axiosReq } from "../../api/axiosDefaults"; function TaskTabs(props) { const { - list + taskList } = props; - const TaskComponent = list ? TaskList : TaskKanban + const TaskComponent = taskList ? TaskList : TaskKanban const currentUser = useCurrentUser(); const profile_id = currentUser?.profile_id || ""; @@ -57,6 +57,7 @@ function TaskTabs(props) { `} > @@ -69,6 +70,7 @@ function TaskTabs(props) { `} > @@ -81,6 +83,7 @@ function TaskTabs(props) { `} > @@ -91,11 +94,14 @@ function TaskTabs(props) { All tasks `} > - + - {list && ( + {taskList && ( )}