<p> </p><div class="raw-html-embed">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.container {
max-width: 300px;
display: flex;
flex-direction: column;
margin: 0 auto;
}
#todo-app {
margin: 1em;
text-align: center;
}
#todo-list,
#todo-stats {
margin: 1em auto;
text-align: left;
width: 450px;
}
#todo-list {
list-style: none;
padding: 0;
}
#todo-stats {
color: #777;
}
#new-todo {
border-radius: 5px;
}
.todo-input {
display: block;
font-family: Helvetica, sans-serif;
font-size: 20px;
line-height: normal;
margin: 5px auto 0;
padding: 6px;
width: 420px;
}
.todo-label {
color: #444;
font-size: 20px;
font-weight: bold;
text-align: center;
}
</style>
<div class="container">
<div id="todo-app">
<label class="todo-label" for="new-todo">What do you want to do today?</label>
<input type="text" id="new-todo" class="todo-input" placeholder="type your tasks">
</div>
<div class="todo-list">
<div class="todo-item">
<input type="checkbox">
<span class="todo-content">task 1</span>
</div>
</div>
</div>
<div id="root"></div>
<script crossorigin="" src="https://unpkg.com/react/umd/react.development.js"></script>
<script crossorigin="" src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
// practice #1
function ToDoLabel() {
return <label className="todo-label" htmlFor="new-todo">What do you want to do today?</label>
}
function ToDoInput() {
return <input type="text" id="new-todo" className="todo-input" placeholder="type your tasks" />
}
function ToDoApp() {
return <div id="todo-app">
<ToDoLabel />
<ToDoInput />
</div>
}
// ////
function ToDoCheckBox() {
return <input type="checkbox" />
}
function ToDoContent() {
return <span className="todo-content">task 1</span>
}
function ToDoList() {
return <div className="todo-list">
<div className="todo-item">
<ToDoContent />
<ToDoCheckBox />
</div>
</div>
}
function ToDo() {
return <div className="container">
<ToDoApp />
<ToDoList />
<ToDoApp />
<ToDoList />
<ToDoApp />
<ToDoList />
</div>
}
ReactDOM.render(<ToDo />, document.getElementById('root'))
</script>
</div>