Created task menu, started habits menu
This commit is contained in:
parent
9fe8405bab
commit
a4ebd7aab3
17 changed files with 623 additions and 37 deletions
|
|
@ -1,30 +1,36 @@
|
|||
import * as React from "react";
|
||||
import TodoItem from "./TodoItem"
|
||||
import Taskview from "../Taskview"
|
||||
import Dailiesview from "../Dailiesview"
|
||||
import Habitsview from "../Habitsview"
|
||||
import Todoview from "../Todoview"
|
||||
import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
|
||||
|
||||
export default function Index(props: any){
|
||||
const incompleteTodos = props.todos.map((todo: any) => {
|
||||
if(!todo.completed)
|
||||
return <TodoItem key={todo.id} id={todo.id} todo_text={todo.text} onChange={props.onChange} completed={todo.completed}/>
|
||||
})
|
||||
const completedTodos = props.todos.map((todo: any) => {
|
||||
if(todo.completed)
|
||||
return <TodoItem key={todo.id} id={todo.id} todo_text={todo.text} onChange={props.onChange} completed={todo.completed}/>
|
||||
})
|
||||
const display = <div id="classDisplay">
|
||||
<Tabs>
|
||||
<TabList>
|
||||
<Tab>Active Todos</Tab>
|
||||
<Tab>Completed Todos</Tab>
|
||||
</TabList>
|
||||
<TabPanel>
|
||||
<ul>{incompleteTodos}</ul>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<ul>{completedTodos}</ul>
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
<Tabs>
|
||||
<TabList>
|
||||
<Tab>
|
||||
<span className="material-icons md-24">task_alt</span>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<span className="material-icons">today</span>
|
||||
</Tab>
|
||||
<Tab>
|
||||
<span className="material-icons">add_circle_outline</span>
|
||||
</Tab>
|
||||
</TabList>
|
||||
<TabPanel>
|
||||
<Habitsview habits={props.state.habits} onChange={props.handleChange} />
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<Dailiesview dailys={props.state.dailys} onChange={props.handleChange} />
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<Todoview todos={props.state.todos} onChange={props.handleChange} />
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
</div>
|
||||
return(display);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue