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

Improved accessibility of text style props for customized toast messages #479

Merged
merged 3 commits into from
Dec 13, 2023

Conversation

EmreKarslan
Copy link
Contributor

@EmreKarslan EmreKarslan commented Jul 13, 2023

Made modifications to enhance the accessibility of text style props in React Native Toast Message library. The existing implementation caused issues when customizing toast messages in my application, particularly with regard to the text style. To address this, I adjusted the code to ensure that the text-style props are easily accessible and can be modified according to specific requirements. These changes resolve the issues I encountered and provide a smoother experience when customizing toast messages.

closes #478

@calintamas
Copy link
Owner

calintamas commented Dec 4, 2023

Hi @EmreKarslan, thanks for your contribution! However, I suggest adding text1Style and text2Style to ToastOptions type, instead of ToastData - for sake of correctness, from a conceptual point of view.

@calintamas
Copy link
Owner

@EmreKarslan when you can, please check the failing test FAIL src/__tests__/useToast.test.ts

@EmreKarslan
Copy link
Contributor Author

EmreKarslan commented Dec 9, 2023

Hi @calintamas, it seems the problem stems from mergeIfDefined. I was passing null as the default value. I think I fixed it when I added text1 and text2 styles as defaults.

@calintamas
Copy link
Owner

@EmreKarslan the expected value needs to be updated in the test case. I suggest keeping the defaults to null (there is no point in duplicating styles) and updating the test case.

@calintamas calintamas merged commit 3ae6f01 into calintamas:main Dec 13, 2023
3 checks passed
@calintamas
Copy link
Owner

thank you, released in 2.1.9

calintamas pushed a commit to wouterds/react-native-toast-message that referenced this pull request Dec 15, 2023
* fix: availability of text1 and text2 style props

* chore(types): move text1Style and text2Style to ToastOptions

* refactor: Update test case to include missing text1Style and text2Style in the options
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.

Inconsistent Availability of text1 and text2 Style Props in toast.show Function
2 participants