birdwingo / react-native-instagram-stories

🚀 Instagram stories is a versatile React Native component designed to display a horizontal scrollable list of user stories, similar to the stories feature found in the Instagram app.
https://birdwingo.com
MIT License
131 stars 35 forks source link

When pressed image of a person inside render story model, How can i navigate if i have userID based on each user story ? #93

Closed Ahsanali012 closed 3 months ago

Ahsanali012 commented 3 months ago

I have my following code , My question is how can i press user image which is imageURL to navigate to my custom made screen as scenario is to show user profile. As we have story.id which works as userID

` if (AllStoriesPosts && AllStoriesPosts.length > 0) { InstaStories = AllStoriesPosts.map((story) => ({ id: story.id, name: story.name, imgUrl: story?.imgUrl,

  stories: story.stories.map((item) => {
    let mediaType: "video" | "image" | undefined;
    if (item.mediaType === "video" || item.mediaType === "image") {
      mediaType = item.mediaType;
    }
    return {
      id: item.id,
      mediaType: mediaType,
      sourceUrl: item.sourceUrl,
      renderContent: () => storyContent(item, story.id),
    };
  }),
}));

} `

LukasFridmansky commented 3 months ago

First of all, do you mean pressing user image in stories list or in story modal header? Secondly, you can't do that with current logic. The only thing you can do use renderAvatar or renderStoryHeader for story modal header. In that case you will need to handle styles and everything. But, if you describe what exactly you have in mind, I could add maybe some new properties

Ahsanali012 commented 3 months ago

First of all, do you mean pressing user image in stories list or in story modal header? Secondly, you can't do that with current logic. The only thing you can do use renderAvatar or renderStoryHeader for story modal header. In that case you will need to handle styles and everything. But, if you describe what exactly you have in mind, I could add maybe some new properties

In stories modal when stories on click modal appears and we have the story header with image , name

LukasFridmansky commented 3 months ago

Hey, you can add onStoryHeaderPress callback to every user, check README

Ahsanali012 commented 3 months ago

Hey, you can add onStoryHeaderPress callback to every user, check README

Thanks I'll try and let you know soon