forked from rpailer/todo-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TodoAdd.jsx
35 lines (30 loc) · 1.03 KB
/
TodoAdd.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Button, Grid, TextField } from "@mui/material";
import React from "react";
export default function TodoAdd (props) {
const { onCreate } = props;
const [inputValue, setInputValue] = React.useState("");
return (
<Grid container>
<Grid md={11} item style={{ paddingRight: 16 }}>
<TextField
placeholder="Add Todo here"
value={inputValue}
onChange={v => setInputValue(v.target.value)}
fullWidth
/>
</Grid>
<Grid md={1} item>
<Button
color="info"
variant="outlined"
onClick={() => onCreate(inputValue)}
sx={{
height: 55,
}}
>
Add
</Button>
</Grid>
</Grid>
)
}