Sas-Areku / app-page

https://app-page-nine.vercel.app
0 stars 0 forks source link

Undo modal should fade in and out no matter what #10

Open Sas-Areku opened 1 year ago

Sas-Areku commented 1 year ago

Undo modals are currently being rendered based on the deletedApps array. Instead, there should be another array controlled by the undo modals, so that there can be a delay between when a deletedApp is removed, and when the undo modal is no longer rendered.

This will ensure constant CSS transitions

Sas-Areku commented 1 year ago

I believe this can be done by simply delaying when the handleUndo function is called.

Essentially:

  1. setShow should be set to false immediately
  2. Then, a setTimeout runs for the duration of the CSS transition (300ms)
  3. After that, the undo function runs

This would be within the undo() and handleCancelUndo() functions within undo.tsx

Sas-Areku commented 1 year ago

This issue is blocked as the UndoItem will re-render when the majority of state changes are made on the Edit component.

Ideally, the UndoItem would never re-render throughout it's displayed time. It would render, stay for 10 seconds unless otherwise acted upon, then unmount after 10 seconds.