WIP refactor notes, ProjectView

This commit is contained in:
notnull 2019-07-08 09:35:18 -04:00
parent 364706b708
commit 337b12ad29
2 changed files with 42 additions and 0 deletions

View File

@ -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

View 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