[BitBuilder] Add "Close form" button #23
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Issue: #22
Plan feedback: Approved by @hbrooks
Implementation:
/src/pages/forms/[id].tsx
file, add a new button next to the 'View live form' button. This button should be styled similarly to the 'View live form' button. The button should be labeled 'Close form'./src/pages/forms/[id].tsx
file, add an onClick event to the 'Close form' button. This event should call a function that uses the Supabase client to update theis_open
value for the correct row in the database. You can use theupdate
method from Supabase client as described in the Supabase docs./src/pages/forms/[id].tsx
file, update the 'Close form' button to be unclickable and appear greyed out when the form is closed. This can be achieved by adding a conditional rendering to the button based on theis_open
status of the form.Report:
Add 'Close form' button to the form detail page
Added 'Close form' button to the form detail pageImplement 'Close form' button functionality
Implemented 'Close form' button functionalityUpdate button state based on form status
Updated the 'Close form' button to be unclickable and appear greyed out when the form is closed.Something look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #22. Then, add the
bitbuilder:create
label to try again. For more information, check the documentation.Generated with ❤️ by www.bitbuilder.ai