Skip to content

Instantly share code, notes, and snippets.

@nirkaufman
Created December 6, 2022 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nirkaufman/951ffa4cf204b84a8f0a5ba57d4486de to your computer and use it in GitHub Desktop.
Save nirkaufman/951ffa4cf204b84a8f0a5ba57d4486de to your computer and use it in GitHub Desktop.
import './App.css';
import {Header} from "./components/Header";
import {Main} from "./components/Main";
import {Footer} from "./components/Footer";
function App() {
const appTitle = 'TodosApp';
const todos = [
{title: 'Learn React', completed: false},
{title: 'Listen to Nir React', completed: false},
{title: 'Learn JS', completed: true},
]
// Events
const addTodo = () => {}
const removeTodo = () => {}
// todo: where should we implemnt it?
const markAsCompleted = () => {}
const clearAllCompleted = () => {}
const toggleAll = () => {}
// todo: pass title, placeholder to header
// todo: pass item left to footer
// todo: BONUS THINK ABOUT EDIT IN PLACE (DOUBLE CLICK TO VHANGE ITEM)
return (
<section className="todoapp">
<Header title={appTitle}
onAddItem={addTodo}
text="What needs to be done?" />
<Main items={todos} />
<Footer />
</section>
)
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment