Skip to content

Commit

Permalink
Add loading ui
Browse files Browse the repository at this point in the history
  • Loading branch information
goncy committed Aug 22, 2023
1 parent c401a58 commit f2c8b5e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
plugins: ["prettier-plugin-tailwindcss"],
},
],
"react/no-array-index-key": "off",
"@typescript-eslint/no-shadow": "off",
"import/order": [
"warn",
Expand Down
20 changes: 20 additions & 0 deletions src/app/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Skeleton from "~/ui/components/feedback/skeleton";

export default function LoadingPage() {
return (
<div className="p-4">
<div className="flex items-center justify-between gap-4">
<Skeleton className="h-10 w-full max-w-xs" />
<div className="flex space-x-2">
<Skeleton className="h-10 w-10 rounded-md" />
<Skeleton className="h-10 w-10 rounded-md" />
</div>
</div>
<div className="mt-4 flex flex-col gap-4">
{Array.from({length: 3}).map((_, index) => (
<Skeleton key={index} className="h-24 w-full rounded-md" />
))}
</div>
</div>
);
}
5 changes: 5 additions & 0 deletions src/modules/ui/components/feedback/skeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {cn} from "../../utils";

export default function Skeleton({className, ...props}: React.HTMLAttributes<HTMLDivElement>) {
return <div className={cn("animate-pulse rounded-md bg-muted", className)} {...props} />;
}

3 comments on commit f2c8b5e

@vercel
Copy link

@vercel vercel bot commented on f2c8b5e Aug 22, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

store – ./

store.goncy.dev
store.gonzalopozzo.com
store-goncy.vercel.app
store-git-main-goncy.vercel.app

@vercel
Copy link

@vercel vercel bot commented on f2c8b5e Aug 22, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on f2c8b5e Aug 22, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.