Skip to content

Commit

Permalink
feat: Add loading state during file upload in Upload component
Browse files Browse the repository at this point in the history
  • Loading branch information
bramses committed Aug 16, 2024
1 parent d9e00da commit b33acc7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/[locale]/(auth)/dashboard/upload/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Upload = () => {

const formData = new FormData();
formData.append('file', file);

setLoading(true);
const response = await fetch(
'https://commonbase-supabase-alpha.onrender.com/cf-images/upload',
{
Expand Down Expand Up @@ -104,6 +104,8 @@ const Upload = () => {
{ key: 'title', value: 'Image' },
]);

setLoading(false);

// add(data2.description);
});
};
Expand Down

0 comments on commit b33acc7

Please sign in to comment.