calintamas / react-native-toast-message

Animated toast message component for React Native
MIT License
1.73k stars 265 forks source link

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

Closed EmreKarslan closed 11 months ago

EmreKarslan commented 1 year ago

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 commented 11 months ago

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 commented 11 months ago

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

EmreKarslan commented 11 months ago

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 commented 11 months ago

@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 commented 11 months ago

thank you, released in 2.1.9