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

Add option to have a click event for the primary button #150

Merged
merged 4 commits into from
Sep 27, 2023

Conversation

vineethasok
Copy link
Collaborator

There is no option to have onClick for the button
So adding a prop to allow onButtonClick and also pass props to the wrapper

@vineethasok vineethasok self-assigned this Sep 26, 2023
@vercel
Copy link

vercel bot commented Sep 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
click-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2023 8:41am

@vineethasok vineethasok changed the title Add Option to have a click event for the primary button Add option to have a click event for the primary button Sep 26, 2023
@@ -13,6 +13,7 @@ export interface CardPrimaryProps {
infoUrl?: string;
infoText?: string;
size?: "sm" | "md";
onButtonClick?: MouseEventHandler<HTMLElement>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think onButtonClick is a bit confusing and might make the user think it applies with a button inside the card? it's already possible to add a onClick event to the card, shouldn't we use the default porp?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The onClick might be needed for the wrapper div thats why I added the onButtonClick
I discussed this yesterday with @gjones and we thought that there would be a case where we need the button to have a different function than the card

@vineethasok vineethasok requested a review from serdec September 26, 2023 18:12
@vineethasok vineethasok merged commit 97ff399 into main Sep 27, 2023
3 checks passed
@vineethasok vineethasok deleted the fix-card-click-function branch September 27, 2023 08:44
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

Successfully merging this pull request may close these issues.

2 participants