WIP refactor notes, ProjectView
This commit is contained in:
parent
364706b708
commit
337b12ad29
19
README.md
19
README.md
@ -0,0 +1,19 @@
|
|||||||
|
# TODO for refactoring
|
||||||
|
|
||||||
|
- update renderProject to renderProjectView
|
||||||
|
- update renderProjects to renderProjectsView
|
||||||
|
- create ProjectsView, ProjectTasksView, UserProjectsView
|
||||||
|
|
||||||
|
- create TasksView, UserTasksView
|
||||||
|
|
||||||
|
# User Stories
|
||||||
|
|
||||||
|
As a user, I want to:
|
||||||
|
|
||||||
|
- View all available projects (should we assume all is public for now?)
|
||||||
|
- View all available tasks
|
||||||
|
- View all available profiles (e.g., to find potential collaborators)
|
||||||
|
|
||||||
|
- View a single project with its tasks (including unassigned)
|
||||||
|
- View a single profile with tasks assigned (to see my tasks, to see anothers' tasks)
|
||||||
|
- Hide completed tasks
|
23
src/components/ProjectView.js
Normal file
23
src/components/ProjectView.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import Tasks from './tasks'
|
||||||
|
|
||||||
|
function Project(props) {
|
||||||
|
// if (!props.selectedProjectId) {
|
||||||
|
// props.navigate('projects')
|
||||||
|
// return null
|
||||||
|
// }
|
||||||
|
// const project = props.projects.find(p => p.id === props.selectedProjectId)
|
||||||
|
// const filtered = props.tasks.filter(t => t.projectId === props.selectedProjectId && !t.completed)
|
||||||
|
// const completed = props.tasks.filter(
|
||||||
|
// t => (t.projectId === props.selectedProjectId && t.completed === true) || null,
|
||||||
|
// )
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<h2>{props.project.name}</h2>
|
||||||
|
<Tasks filtered={props.filtered} completed={props.completed} {...props} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Project
|
Loading…
x
Reference in New Issue
Block a user