diff --git a/package.json b/package.json index abe85b5..c6d625f 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "src/index.tsx", "source": "src/index.tsx", "scripts": { + "prepare": "husky install", "build": "tsc -p tsconfig.json", "release": "standard-version", "test": "jest --coverage" diff --git a/src/components/Modal/index.tsx b/src/components/Modal/index.tsx index 37efdb8..e6bf664 100644 --- a/src/components/Modal/index.tsx +++ b/src/components/Modal/index.tsx @@ -204,6 +204,10 @@ const StoryModal = forwardRef( ( { scrollTo( previousUserId.value ); + } else { + + return false; + } } else { @@ -225,6 +229,8 @@ const StoryModal = forwardRef( ( { } + return true; + }; const show = ( id: string ) => { @@ -342,7 +348,13 @@ const StoryModal = forwardRef( ( { } else if ( ( pressInformation.value.x ) < WIDTH / 2 ) { - toPreviousStory(); + const success = toPreviousStory(); + + if ( !success ) { + + startAnimation( true ); + + } } else { diff --git a/src/core/dto/instagramStoriesDTO.ts b/src/core/dto/instagramStoriesDTO.ts index 375ee55..5ad8096 100644 --- a/src/core/dto/instagramStoriesDTO.ts +++ b/src/core/dto/instagramStoriesDTO.ts @@ -1,5 +1,8 @@ import { ReactNode } from 'react'; -import { ScrollViewProps, TextStyle, ViewStyle } from 'react-native'; +import { + ImageStyle, + ScrollViewProps, TextStyle, ViewStyle, +} from 'react-native'; export interface StoryItemProps { id: string; @@ -38,6 +41,7 @@ export interface InstagramStoriesProps { progressColor?: string; modalAnimationDuration?: number; mediaContainerStyle?: ViewStyle; + imageStyles?: ImageStyle; onShow?: ( id: string ) => void; onHide?: ( id: string ) => void; onSwipeUp?: ( userId?: string, storyId?: string ) => void;