Closed Polarisation closed 1 year ago
Thank you for this work @Polarisation! The code looks great, I'll just need to find some time to test before officially merging. It may be a few weeks, but I will get to it.
Because you reached out via email about being able to include this in your own app, I just wanted to offer that you CAN use this immediately -- you just need to use your fork in your app instead of this library directly. You can find articles about this online, here's one for example that seems useful: https://blaipratdesaba.com/how-to-use-an-npm-node-module-that-has-been-forked-b7dd522fdd08. Hope it helps, cheers!
@cooperka Thanks that's helpful. Keen to stay aligned on the main package but may use the fork short term 👍
Made a few further tweaks:
marginLeft
and marginRight
options as I couldn't find an implementation which works reliably. (it's also not important for my use case, which is to raise the snackbar above a bottom tab bar)com.google.android.material
to the latest (1.3.0
) to support the fade animation. After doing this, I also needed to add an explicit androidx.swiperefreshlayout
dependency.Want this feature to be merged. Kind of a necessary one. Thank you!
Definitely is a really nice to have feature!
Update: Rebased on latest main
with dependency upgrades; works great on Android! Now to spend a few more hours setting up xcode... I should have this ready to merge tomorrow.
Facebook's support for upgrading RN modules is truly despicable... I'll need to start a new module from scratch and re-apply this library's code on top of it.
For anyone wanting to use this feature right away, you can: just point to the code at cooperka/react-native-snackbar
, branch feature/margins
where I've committed the compiled lib
directory. There's NO reason you can't use this feature RIGHT NOW in your app.
I will merge this PR after I'm able to test on iOS. It will take several more days before I have time to keep going. Thanks again for the great submission @Polarisation, I have no concerns that it works, I just need to be able to verify before shipping new code.
I integrated my fork into an app with the following edits to package.json
:
"dependencies": {
"react-native-snackbar": "https://github.com/Polarisation/react-native-snackbar.git#feature/margins"
},
"scripts": {
"build-snackbar": "cd ./node_modules/react-native-snackbar && yarn install && rm -rf node_modules example",
"postinstall": "yarn build-snackbar"
},
Probably easier to use the compiled branch @cooperka prepared above, but just thought I'd share this snippet, it might be helpful for anyone submitting Pull Requests in future.
merge
Can we merge this now?
- In a bottom margin is set, the animation will now fade in/out, rather than slide up/down.
- Removed the
marginLeft
andmarginRight
options as I couldn't find an implementation which works reliably. (it's also not important for my use case, which is to raise the snackbar above a bottom tab bar)
Hi @cooperka (https://github.com/cooperka), any way we can have all margins setable as you tried before? or perhaps a custamizable styling of the box? I am unsure how difficult it is to build this. My wish is to have the snackbar floating at the bottom but not touching any side . So basically I would love to have it like this example found in MUI docs:
Is what I'm asking possible with this library? Thanks for the efforts.
still untested by me on iOS, but has a lot of love from the community! thanks again @Polarisation.
released as v2.6.0 🎉
See #15
This allows a bottom margin to be set. This can be used to place the snackbar above navigational elements such as a tab bar at the bottom of the screen.