diff --git a/public/style.css b/public/style.css index 43c223c..73ec3e7 100644 --- a/public/style.css +++ b/public/style.css @@ -73,7 +73,7 @@ button { line-height: 0; height: 24px; - width: 100px; + width: calc(100% + 2px); padding: 0 10px; font-size: 12px; background: #fff; diff --git a/web/index.ts b/web/index.ts index bacf09d..180471c 100644 --- a/web/index.ts +++ b/web/index.ts @@ -355,6 +355,20 @@ const App = (_: any, state: AppState, setState: SetState) => { setLoadingState({ heights: clone }); } }) + ), + H('div', + { className: 'field-flex' }, + H(Button, { + label: `Remove Image ${i + 2}`, + onclick: (e: MouseEvent) => { + e.preventDefault(); + const filter = (arr: any[]) => [...arr].filter((_, n) => n !== i + 1); + const imagesClone = filter(images); + const widthsClone = filter(widths); + const heightsClone = filter(heights); + setLoadingState({ images: imagesClone, widths: widthsClone, heights: heightsClone }); + } + }) ) ) })),