nandorojo / burnt

Crunchy toasts for React Native. 🍞
MIT License
1.16k stars 36 forks source link

Support `presentSide` option on `SPIndicator` #8

Closed filipstefansson closed 1 year ago

filipstefansson commented 1 year ago

This PR adds support for the presentSide option on SPIndicator.

With this you can show the toast at the bottom of the screen on iOS by adding from: 'bottom' when calling Burnt.toast() (this mimics the API from SPIndicator, but feel free to change the option name if something else is more clear).

I tried to get it working on Android to support showing the toast at the top, but it does not work like its described in the docs:

https://reactnative.dev/docs/toastandroid

ToastAndroid.showWithGravityAndOffset(
  title,
  duration * 1000,
  from === 'bottom' ? ToastAndroid.BOTTOM : ToastAndroid.TOP, // does not work
  25,
  50
);

The JSDoc makes it clear that this is iOS only.

nandorojo commented 1 year ago

looks good to me. any shot you could add a video of it working on iOS before i merge?

filipstefansson commented 1 year ago

looks good to me. any shot you could add a video of it working on iOS before i merge?

https://user-images.githubusercontent.com/472270/212833301-e8c0a6b4-c173-490c-852d-4fe7a710f94b.mov