Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement a loading state when fetching application data #192

Open
fvcci opened this issue Oct 2, 2024 · 0 comments
Open

feat: implement a loading state when fetching application data #192

fvcci opened this issue Oct 2, 2024 · 0 comments

Comments

@fvcci
Copy link
Contributor

fvcci commented Oct 2, 2024

Currently, the code may not handle the loading state appropriately. When the data is being fetched, it's ideal to inform the user that loading is in progress. Consider using the isLoading property to detect when data is being fetched and display a loading indicator during that time.

Update the code to handle the loading state:

+import LoadingSpinner from "../components/LoadingSpinner"; // Ensure you have a LoadingSpinner component

// TODO: add loading screen on content load
-const statusToUse = isApplicationLoaded ? application?.status : null;
-return statusToUse ? stateMap[statusToUse] : null;
+
+if (isLoading) {
+  return <LoadingSpinner />;
+}
+
+const statusToUse = application?.status;
+return statusToUse ? stateMap[statusToUse] : null;

Committable suggestion was skipped due to low confidence.

Originally posted by @coderabbitai[bot] in #191 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant