skorphil / nextjs-form

Educational NextJs project to build a complex mobile-first form
https://www.chromatic.com/library?appId=65b2882ac1586a6b21cba0dd
MIT License
3 stars 0 forks source link

prevent adding multiple records per month. Ask to override #70

Closed skorphil closed 4 months ago

skorphil commented 4 months ago

At the moment users can create multiple records per month. There are several problems: 1) User may not realize, that this month is already logged. 2) What to do with multiple records per month if all graphs work with 1 record per month?

skorphil commented 4 months ago

I think it is better to perform this check on themain page (i.e not show the create record button if this month's record exists already)

But the user still can open with a direct link like /?newrecord=true. to address this issue, a special state can be created where the user must explicitly confirm the intention to overwrite the existing record

skorphil commented 4 months ago

This is more UX question. For the sake of React practice, I will make a new component - FormWarning. In the future, it will probably be used for errors in form idk.

Image

skorphil commented 4 months ago

https://github.com/skorphil/nextjs-form/assets/6762009/22958168-ffd4-4807-915b-2b0c20b09d44

skorphil commented 4 months ago

For now not overwriting the record. Just appending new one