Skip to content

Commit

Permalink
feat(stories): add ability to start playing stories from a specific s…
Browse files Browse the repository at this point in the history
…tory index (birdwingo#113)
  • Loading branch information
Adil7767 committed Oct 3, 2024
1 parent ddc2884 commit ff63a4e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/InstagramStories/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ const InstagramStories = forwardRef<InstagramStoriesPublicMethods, InstagramStor

},
clearProgressStorage,
goToSpecificStory:(userId:string,index:number)=>modalRef.current?.goToSpecificStory(userId,index),
hide: () => modalRef.current?.hide(),
show: ( id ) => {

Expand Down
1 change: 1 addition & 0 deletions src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ const StoryModal = forwardRef<StoryModalPublicMethods, StoryModalProps>( ( {
getCurrentStory: () => ( { userId: userId.value, storyId: currentStory.value } ),
goToPreviousStory: toPreviousStory,
goToNextStory: toNextStory,
goToSpecificStory:(userId:string,index:number)=>{scrollTo(userId, true, false, undefined, index)},
} ), [ userId.value, currentStory.value ] );

useEffect( () => {
Expand Down
4 changes: 4 additions & 0 deletions src/core/dto/componentsDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export type StoryModalPublicMethods = {
goToPreviousStory: () => void;
goToNextStory: () => void;
getCurrentStory: () => { userId?: string, storyId?: string };
goToSpecificStory:(
userId?: string,
index?: number,
)=>void;
};

export type GestureContext = {
Expand Down
4 changes: 4 additions & 0 deletions src/core/dto/instagramStoriesDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,8 @@ export type InstagramStoriesPublicMethods = {
goToPreviousStory: () => void;
goToNextStory: () => void;
getCurrentStory: () => { userId?: string, storyId?: string };
goToSpecificStory:(
userId?: string,
index?: number,
)=>void;
};

0 comments on commit ff63a4e

Please sign in to comment.