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

feat: added customizeable close button #130

Merged

Conversation

ljukas
Copy link
Contributor

@ljukas ljukas commented Oct 4, 2024

Summary

Adds basic functionality for customising close button.
Moved the rendering to a useMemo hook to make it easier to follow the logic flow, since I did not want to break existing usages of the closeButton prop

Test plan

There is an example usage in the example app. Basically it tries to mimic the action and cancel actions except we only accept a ReactNode instead of a ToastAction

Fixes #129

Copy link
Owner

@gunnartorfis gunnartorfis left a comment

Choose a reason for hiding this comment

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

👏 just a minor comment about typechecking

src/toast.tsx Outdated Show resolved Hide resolved
@ljukas
Copy link
Contributor Author

ljukas commented Oct 4, 2024

Just a note, I think a continuation of the custom-component structure could be to accept a function instead and there we can pass theme prop etc for the custom components and they can depend on that. Makes it easier to wrap a wrapped around sonner-native for custom styles etc

@gunnartorfis gunnartorfis merged commit 2c68249 into gunnartorfis:main Oct 4, 2024
3 checks passed
@gunnartorfis
Copy link
Owner

Released in 0.15.0, thanks for the contribution! 👏

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.

Customize close button
2 participants