Skip to content
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

added props #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "animation-wrapper-view",
"description": "Create declarative animations for React Native",
"version": "1.1.2",
"version": "1.1.3",
"repository": {
"type": "git",
"url": "git+https://github.com/flipkart-incubator/animation-wrapper-view.git"
Expand Down
1 change: 1 addition & 0 deletions src/core/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type AnimationWrapperProps = {
animationConfig: BaseAnimationConfig;
onAnimationFinish?: (animationConfig?: BaseAnimationConfig) => void;
onAnimationStart?: (animationConfig?: BaseAnimationConfig) => void;
animationWrapperStyles?:object;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you upcast the type from object?

}

type SlideAnimationProps = AnimationWrapperProps;
Expand Down
4 changes: 2 additions & 2 deletions src/core/components/wrapper/BaseAnimationWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export abstract class BaseAnimationWrapper<P extends AnimationWrapperProps> exte
const content = this.props.children;
if (this.props.animationConfig?.triggerType === AnimationTriggerType.ON_CLICK) {
return (
<TouchableWithoutFeedback onPress={this._onPress}>
<TouchableWithoutFeedback onPress={this._onPress} style={this.props?.animationWrapperStyles}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a description of this prop, and what do you intend to do with this?

Also, you'll need to update the documentation if you're adding new props to the BaseAnimationWrapper

{this.renderAnimation(content)}
</TouchableWithoutFeedback>
);
} else {
return (
<View>
<View style={this.props?.animationWrapperStyles}>
{this.renderAnimation(content)}
</View>
)
Expand Down