testshallpass / react-native-dropdownalert

An alert to notify users about an error or something else
MIT License
1.85k stars 252 forks source link

Add support for bottom position #234

Closed timnlupo closed 10 months ago

timnlupo commented 3 years ago

Hi all! I'm thinking about adding support for a position prop with options top or bottom. This would allow users to specify whether they want the notification to drop down from the top or pop up from the bottom. Similar to the functionality in this repo.

Please lmk what you think before I invest the time in building it out. Thanks.

intechsol20 commented 3 years ago

Yes. I want that too.

testshallpass commented 3 years ago

A position prop would be a nice convenient way. This though is currently supported by setting startDelta and endDelta to the window height (useWindowDimensions().height).

timnlupo commented 3 years ago

I just tried this, you actually need to set

startDelta={useWindowDimensions().height}
endDelta={useWindowDimensions().height - height} // height is the height of the alert

Since height is saved in the DropdownAlert's state, I think it makes sense to add a position prop to be able to easily toggle it. Otherwise, a user has to add an onLayout to a view surrounding the DropdownAlert (which gets messy).

Going to work on this (should be pretty straightforward) and will update here.

shawnFallon commented 3 years ago

Are there any updates to this?

testshallpass commented 11 months ago

I have simplified to a single animation flow from the top in latest release. That being said, I am open to support the inverse. I will take a look at the feasibility soon.

testshallpass commented 11 months ago

Update: implemented in PR #302

testshallpass commented 10 months ago

Completed in v5.1.0