From 23cd1d8efdf3fe7cddd63948baece4fae1062325 Mon Sep 17 00:00:00 2001 From: Samagra Gupta <32234926+samagragupta@users.noreply.github.com> Date: Thu, 5 Jan 2023 15:29:04 +0530 Subject: [PATCH 1/6] Update README.MD --- README.MD | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.MD b/README.MD index 89c35e9..a427c7b 100644 --- a/README.MD +++ b/README.MD @@ -64,11 +64,13 @@ private _onPressToReset = (_: GestureResponderEvent) => { ``` ### AnimationWrapperView props -| Prop name | Prop Type | Description | -| --- | --- | --- | +| Prop name | Prop Type | Description | +| --- | --- |--------------------------------------------------------------------------------------------------------------------------------------------------------| | animationConfig | BaseAnimation | Object which will contain all optional and non-optional parameters needed to render the animation, including AnimationType, AnimationTriggerType, etc. | -| onAnimationFinish | () => void | (optional) Callback function, if provided will be invoked once animation is finished. | -| onAnimationStart | () => void | (optional) Callback function, if provided will be invoked when the animation is triggered. | +| onAnimationFinish | () => void | (optional) Callback function, if provided will be invoked once animation is finished. | +| onAnimationStart | () => void | (optional) Callback function, if provided will be invoked when the animation is triggered. | +| animationWrapperStyles | StyleProp | (optional) Styling, if provided will be applied to the JSON animation element. | +| baseAnimationStyles | StyleProp | (optional) Styling, if provided will be applied to the root element. | ## Types of supported Animations From 065f0dcc7b90d962e6c6f9147cebf93f2b72c93f Mon Sep 17 00:00:00 2001 From: Samagra Gupta <32234926+samagragupta@users.noreply.github.com> Date: Thu, 5 Jan 2023 15:30:33 +0530 Subject: [PATCH 2/6] Update Types.ts --- src/core/Types.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/Types.ts b/src/core/Types.ts index bb7641c..1546db8 100644 --- a/src/core/Types.ts +++ b/src/core/Types.ts @@ -6,6 +6,7 @@ import { RippleAnimationProps } from "./components/wrapper/RippleAnimationWrappe import { ScaleAnimationProps } from "./components/wrapper/ScaleAnimationWrapper"; import { WiggleAnimationProps } from "./components/wrapper/WiggleAnimationWrapper"; import BaseAnimationConfig from "./data/BaseAnimationConfig"; +import { StyleProp, ViewStyle } from "react-native"; /** * Append the React.ComponentClass for each class extending from BaseAnimationWrapper @@ -23,6 +24,8 @@ type AnimationWrapperProps = { animationConfig: BaseAnimationConfig; onAnimationFinish?: (animationConfig?: BaseAnimationConfig) => void; onAnimationStart?: (animationConfig?: BaseAnimationConfig) => void; + animationWrapperStyles?: StyleProp; + baseAnimationStyles?: StyleProp; } type SlideAnimationProps = AnimationWrapperProps; From 7149d5c67f6b4db21a27caf7f0522b437337143f Mon Sep 17 00:00:00 2001 From: Samagra Gupta <32234926+samagragupta@users.noreply.github.com> Date: Thu, 5 Jan 2023 15:32:00 +0530 Subject: [PATCH 3/6] Update AnimationWrapperView.tsx --- src/core/components/AnimationWrapperView.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/components/AnimationWrapperView.tsx b/src/core/components/AnimationWrapperView.tsx index 2a1faf9..0153317 100644 --- a/src/core/components/AnimationWrapperView.tsx +++ b/src/core/components/AnimationWrapperView.tsx @@ -35,14 +35,16 @@ export default class AnimationWrapperView extends React.Component + onAnimationStart={onAnimationStart} + animationWrapperStyles={animationWrapperStyles} + baseAnimationStyles={baseAnimationStyles}> {children} ); From afb20df495fb38dbb763404cc0c796f6b5c6e482 Mon Sep 17 00:00:00 2001 From: Samagra Gupta <32234926+samagragupta@users.noreply.github.com> Date: Thu, 5 Jan 2023 15:32:35 +0530 Subject: [PATCH 4/6] Update BaseAnimationWrapper.tsx --- src/core/components/wrapper/BaseAnimationWrapper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/components/wrapper/BaseAnimationWrapper.tsx b/src/core/components/wrapper/BaseAnimationWrapper.tsx index 32ac992..bfa2402 100644 --- a/src/core/components/wrapper/BaseAnimationWrapper.tsx +++ b/src/core/components/wrapper/BaseAnimationWrapper.tsx @@ -31,13 +31,13 @@ export abstract class BaseAnimationWrapper

exte const content = this.props.children; if (this.props.animationConfig?.triggerType === AnimationTriggerType.ON_CLICK) { return ( - + {this.renderAnimation(content)} ); } else { return ( - + {this.renderAnimation(content)} ) From 078dc35da64d6b74d8088196b7def0543d42da96 Mon Sep 17 00:00:00 2001 From: Samagra Gupta <32234926+samagragupta@users.noreply.github.com> Date: Thu, 5 Jan 2023 15:33:25 +0530 Subject: [PATCH 5/6] Update JsonAnimationWrapper.tsx --- src/core/components/wrapper/JsonAnimationWrapper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/components/wrapper/JsonAnimationWrapper.tsx b/src/core/components/wrapper/JsonAnimationWrapper.tsx index 80eeb2a..75ec494 100644 --- a/src/core/components/wrapper/JsonAnimationWrapper.tsx +++ b/src/core/components/wrapper/JsonAnimationWrapper.tsx @@ -45,7 +45,7 @@ export class JsonAnimationWrapper extends BaseAnimationWrapper + {content} ); From 34ab14991c182c19405e6d9f06d3c8922d6bd2e2 Mon Sep 17 00:00:00 2001 From: Samagra Gupta <32234926+samagragupta@users.noreply.github.com> Date: Thu, 5 Jan 2023 15:35:42 +0530 Subject: [PATCH 6/6] Update BaseAnimationWrapper.tsx --- src/core/components/wrapper/BaseAnimationWrapper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/components/wrapper/BaseAnimationWrapper.tsx b/src/core/components/wrapper/BaseAnimationWrapper.tsx index bfa2402..09097c2 100644 --- a/src/core/components/wrapper/BaseAnimationWrapper.tsx +++ b/src/core/components/wrapper/BaseAnimationWrapper.tsx @@ -31,13 +31,13 @@ export abstract class BaseAnimationWrapper

exte const content = this.props.children; if (this.props.animationConfig?.triggerType === AnimationTriggerType.ON_CLICK) { return ( - + {this.renderAnimation(content)} ); } else { return ( - + {this.renderAnimation(content)} )