-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support coustom popup body #17
Conversation
I think for custom body, we could use |
I think your approach is good. Just ignore my previous comment. |
Yes, The parameters are passed through the |
I wonder if the shadow style can be separated from the animation style, because I need to modify the shadow 😅 |
@taixw2 You may try removing the shadow and radius from <Animated.View
style={getAnimatedContainerStyle({containerSlideOffsetY, containerDragOffsetY, containerScale})}
{...this._panResponder.panHandlers}>
<TouchableWithoutFeedback onPress={onPressAndSlideOut}>
<View> // <-- put style HERE I haven't try this yet, but in this way, everyone can customize the shadow using their own custom body. |
Since I have merged #20. Could you also update the typescript typings for the new prop? Thanks so much for the contribution and sorry for the late replies. |
@carsonwah I have added the corresponding type definition and added style prop. |
I think we can let user customize the whole popup body. So, I would propose something like: <Animated.View
style={getAnimatedContainerStyle({containerSlideOffsetY, containerDragOffsetY, containerScale})}
{...this._panResponder.panHandlers}>
<TouchableWithoutFeedback onPress={onPressAndSlideOut}>
<View> // No style here
{this.renderPopupContent()}
</View>
</TouchableWithoutFeedback>
</Animated.View> renderPopupContent() {
const { appIconSource, appTitle, timeText, title, body } = this.state;
const { renderPopupContent } = this.props;
if (renderPopupContent) {
return renderPopupContent({ appIconSource, appTitle, timeText, title, body });
}
return (
<View style={styles.popupContentContainer}> // <-- Moved here, i.e. show shadow only for default popup I cannot commit to your branch, so if you would like to, I can merge this PR first and add amendments. |
Agree, your approach is better. |
Merged. Thanks for the contribution! |
No description provided.