This commit is contained in:
Renan LE CARO 2025-03-31 20:13:47 +02:00
parent af65f22c70
commit d31f8ef0b4
12 changed files with 124 additions and 115 deletions

View file

@ -53,7 +53,7 @@ function App() {
>
<div id={"levels"}>
{levels.map((level, li) => {
const { name,credit, bricks, size, svg, color } = level;
const { name, credit, bricks, size, svg, color } = level;
const brickButtons = [];
for (let x = 0; x < size; x++) {
@ -97,23 +97,19 @@ function App() {
return (
<div key={li}>
<input
className={"name"}
className={"name"}
type="text"
value={name}
onChange={(e) => updateLevel(li, { name: e.target.value })}
/>
<input
className={"credit"}
className={"credit"}
type="text"
value={credit||''}
value={credit || ""}
onChange={(e) => updateLevel(li, { credit: e.target.value })}
/>
<div
className={"buttons"}
>
<div className={"buttons"}>
<button onClick={() => deleteLevel(li)}>Delete</button>
<button onClick={() => updateLevel(li, resizeLevel(level, -1))}>
-