Skip to content

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

@rahul-mahato

Description

@rahul-mahato

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions