Browse Source

fixed form

master
Danilo Di Cuia 3 years ago
parent
commit
539ee83e73
  1. 18363
      package-lock.json
  2. 1
      package.json
  3. 4
      src/MyForm.js
  4. 6
      src/index.js

18363
package-lock.json generated

File diff suppressed because it is too large Load Diff

1
package.json

@ -6,6 +6,7 @@
"dependencies": { "dependencies": {
"@emotion/react": "^11.10.5", "@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5", "@emotion/styled": "^11.10.5",
"@mui/icons-material": "^5.11.0",
"@mui/material": "^5.11.1", "@mui/material": "^5.11.1",
"@testing-library/jest-dom": "^5.16.5", "@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0", "@testing-library/react": "^13.4.0",

4
src/MyForm.js

@ -77,13 +77,13 @@ export const MyForm = () => {
<TextField <TextField
multiline multiline
rows={4} rows={4}
{...register("testo", { required: true, maxLength: 20 })} {...register("testo")}
id="outlined-basic" id="outlined-basic"
label="messaggio" label="messaggio"
variant="outlined" variant="outlined"
/> />
<TextField <TextField
{...register("autore", { pattern: /^[A-Za-z]+$/i })} {...register("autore")}
id="outlined-basic" id="outlined-basic"
label="da" label="da"
variant="outlined" variant="outlined"

6
src/index.js

@ -1,3 +1,4 @@
import DeleteIcon from "@mui/icons-material/Delete";
import "./App.css"; import "./App.css";
import React from "react"; import React from "react";
import ReactDOM from "react-dom/client"; import ReactDOM from "react-dom/client";
@ -38,6 +39,11 @@ export function CheckboxListSecondary({ messaggi, onChecked }) {
return ( return (
<ListItem <ListItem
key={m.timestamp} key={m.timestamp}
primaryAction={
<Button variant="outlined" startIcon={<DeleteIcon />}>
Delete
</Button>
}
secondaryAction={ secondaryAction={
<Checkbox <Checkbox
edge="end" edge="end"

Loading…
Cancel
Save