kuasha420/react-native-paper-toast

feat: Override message text style

Closed this issue · 5 comments

Great lib, thanks for making this !

One suggestion I have is the ability to override the message style.
Currently its not configurable.

We could introduce a new prop called messageStyle that we can pass to the Text component.

Let me know what you think.

Actually it seems like this PR solves the issue, can we get it merged ?

#5

+1

if you remove your react-native-paper-toast and then use either of these

yarn:
yarn add https://github.com/kuasha420/react-native-paper-toast#3b474847a5275ed586a41d283301986f23fe8b90

npm:
npm install https://github.com/kuasha420/react-native-paper-toast#3b474847a5275ed586a41d283301986f23fe8b90

you will get the ability to add 3 new properties to the toast - snackbarStyle, messageStyle and messageContainerStyle

I'm using 2 of the new properties and the 'minWidth' fixes the very thin green snackbar (no text visible) and the 'flexDirection: 'row'' fixes the stacked layout (Icon above the text - now it's inline)

toaster.show({ type: type, message: message, snackbarStyle: { minWidth: 300 }, messageContainerStyle: { flex: 1, flexDirection: 'row' } });

the above fix actualises the solution in @kidculli comment on 21 Nov 2022

#5

Included in latest release.