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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

This would help to add multiple user stories using this single container #52

Open
rahul-mahato opened this issue Feb 11, 2023 · 0 comments

Comments

@rahul-mahato
Copy link

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch react-native-stories-view@1.0.9 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-stories-view/src/stories/StoryContainer.tsx b/node_modules/react-native-stories-view/src/stories/StoryContainer.tsx
index 7abad0d..7439285 100644
--- a/node_modules/react-native-stories-view/src/stories/StoryContainer.tsx
+++ b/node_modules/react-native-stories-view/src/stories/StoryContainer.tsx
@@ -30,8 +30,8 @@ const StoryContainer = (props: StoryContainerProps) => {
 
 	useEffect(() => {
 		// Alert.prompt("Called")
-		setProgressIndex(progressIndex);
-	}, [props.enableProgress]);
+		if(props.enableProgress ){ setProgressIndex(0); }
+	}, [props.enableProgress, props.toggleProgressFromStart]);
 
 	useEffect(() => {
 		let listener1 = Keyboard.addListener("keyboardDidShow", onShowKeyboard);
@@ -149,7 +149,7 @@ const StoryContainer = (props: StoryContainerProps) => {
 						duration={props.duration ? props.duration : DEFAULT_DURATION}
 						barStyle={props.barStyle}
 						progressIndex={progressIndex}
-						onChange={(position: number) => onChange(position)}
+						onChange={onChange}
 					/>
 				</View>
 			</View>
diff --git a/node_modules/react-native-stories-view/src/utils/interfaceHelper.tsx b/node_modules/react-native-stories-view/src/utils/interfaceHelper.tsx
index 45ddbad..5b3191d 100644
--- a/node_modules/react-native-stories-view/src/utils/interfaceHelper.tsx
+++ b/node_modules/react-native-stories-view/src/utils/interfaceHelper.tsx
@@ -23,7 +23,7 @@ export interface StoryContainerProps extends CommonProps {
     isShowReply?: boolean | undefined,
     duration?: number | undefined,
     barStyle?: BarStyleProps | undefined,
- 
+    toggleProgressFromStart?: boolean | undefined,
     headerComponent?: FunctionComponentElement<CommonProps> | undefined
     userProfile?: UserProps | undefined
 

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant