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

fix: removed loader from inbox #420

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/frontend/src/components/Inbox/InboxItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ export const InboxItems: React.FC = () => {
[updateItem, session]
)

if (isLoading) {
/* if (isLoading) {
return (
<div className="flex flex-col gap-4">
<p>loading...</p>
</div>
)
}
} */
Comment on lines +101 to +107
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Consider implementing a better loading state pattern.

While removing the basic loading text improves the UI, we should still provide users with feedback during data fetching. Consider implementing a skeleton loader or a subtle loading indicator to maintain good UX.

Here's a suggested implementation using a skeleton loader:

+ import { Skeleton } from "@/components/ui/skeleton"
+
+ if (isLoading) {
+   return (
+     <div className="flex flex-col gap-4">
+       {[...Array(3)].map((_, i) => (
+         <div key={i} className="flex items-center space-x-4">
+           <Skeleton className="h-4 w-4 rounded-full" />
+           <div className="space-y-2">
+             <Skeleton className="h-4 w-[250px]" />
+             <Skeleton className="h-4 w-[200px]" />
+           </div>
+         </div>
+       ))}
+     </div>
+   )
+ }

Committable suggestion was skipped due to low confidence.


const menuItems = (item: CycleItem) => [
{
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/src/lib/store/cycle.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export const useCycleItemStore = create<ExtendedCycleItemStore>((set) => ({
error: errorMessage,
isLoading: false,
}))
throw error
}
},

Expand Down