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

Refactor: I changed cursor to progress in button loading state for improved usability. #3662

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
10 changes: 6 additions & 4 deletions apps/www/__registry__/default/example/button-loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { Button } from "@/registry/default/ui/button"

export default function ButtonLoading() {
return (
<Button disabled>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Please wait
</Button>
<div className="cursor-progress">
Copy link

Choose a reason for hiding this comment

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

In my opinion, unnecessary addition of a div, you can add a className to the button.

Copy link
Author

Choose a reason for hiding this comment

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

Hi hope ur well @M4xymS, I tried that approach because I know it's better, but the logic didn't work due to the button's design. So, this is the best solution.

<Button disabled>
<Loader2 className="mr-2 h-4 w-4 animate-spin " />
Please wait
</Button>
</div>
)
}
10 changes: 6 additions & 4 deletions apps/www/registry/default/example/button-loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { Button } from "@/registry/default/ui/button"

export default function ButtonLoading() {
return (
<Button disabled>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
Please wait
</Button>
<div className="cursor-progress">
<Button disabled>
<Loader2 className="mr-2 h-4 w-4 animate-spin " />
Please wait
</Button>
</div>
)
}
10 changes: 6 additions & 4 deletions apps/www/registry/new-york/example/button-loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { Button } from "@/registry/new-york/ui/button"

export default function ButtonLoading() {
return (
<Button disabled>
<ReloadIcon className="mr-2 h-4 w-4 animate-spin" />
Please wait
</Button>
<div className="cursor-progress">
<Button disabled>
<ReloadIcon className="mr-2 h-4 w-4 animate-spin " />
Please wait
</Button>
</div>
)
}