[web] Call create_thread from CommunityCreationModal on form submission
Summary:
We send a request to the create_thread endpoint with the community name and announcement setting selected by the user in CommunityCreationModal.
We show a spinner when the request is loading.
We display an error message and style the button if the request fails. The error message and styling is cleared when:
- The user makes a change to any of the inputs (name or announcement).
- The user clicks the button and re-attempts submitting the form.
If the request succeeds, we navigate to the newly created community root thread.
In subsequent diff we will bring up an "Add members" modal (after a small delay?) after displaying the newly created thread.
Test Plan:
Tested "happy case" by creating multiple communities and ensuring that they were created as expected by checked threads table and navigating to them in the web app.
Also modified threadCreationResponder to immediately throw new ServerError("Error") to simulate request failure case. Ensured that errorMessage + button styling appeared as expected. Then updated the endpoint to return successfully, retried request, and ensured it went through as expected.
Reviewers: ashoat, ginsu
Reviewed By: ashoat
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D7847