Skip to content

Commit

Permalink
fix: pr
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasFridmansky committed Oct 12, 2024
1 parent b9a7018 commit e230902
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default YourComponent;
`progressContainerStyle` | ViewStyle | | Additional styles for the story progress container
`hideAvatarList` | boolean | false | A boolean indicating whether to hide avatar scroll list
`hideElementsOnLongPress` | boolean | false | A boolean indicating whether to hide all elements when story is paused by long press
| `hideOverlayOnLongPress` | `boolean` | (Optional) Controls whether the image overlay hides when `hideElementOnLongPress` is set to `true`. If `true`, the overlay will hide along with other elements on long press. If `false`, only the other elements (e.g., header, progress bar) will hide, and the overlay will remain visible. Default is the value of `hideElementOnLongPress`. |
`hideOverlayOnLongPress` | `boolean` | The value of `hideElementOnLongPress` | Controls whether the image overlay hides when `hideElementOnLongPress` is set to `true`. If `true`, the overlay will hide along with other elements on long press. If `false`, only the other elements (e.g., header, progress bar) will hide, and the overlay will remain visible.
`loopingStories` | `'none'` | `'onlyLast'` | `'all'` | `'none'` | A string indicating whether to continue stories after last story was shown. If set to `'none'` modal will be closed after all stories were played, if set to `'onlyLast'` stories will loop on last user only after all stories were played. If set to `'all'` stories will play from beginning after all stories were played.
`statusBarTranslucent` | boolean | false | A property passed to React native Modal component
`footerComponent` | ReactNode | | A custom component, such as a floating element, that can be added to the modal.
Expand Down
35 changes: 20 additions & 15 deletions src/components/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import StoryFooter from '../Footer';
const StoryList: FC<StoryListProps> = ( {
id, stories, index, x, activeUser, activeStory, progress, seenStories, paused,
onLoad, videoProps, progressColor, progressActiveColor, mediaContainerStyle, imageStyles,
imageProps, progressContainerStyle, imageOverlayView, hideElements,hideOverlayViewOnLongPress, videoDuration, ...props
imageProps, progressContainerStyle, imageOverlayView, hideElements, hideOverlayViewOnLongPress,
videoDuration, ...props
} ) => {

const imageHeight = useSharedValue( HEIGHT );
Expand Down Expand Up @@ -58,21 +59,25 @@ const StoryList: FC<StoryListProps> = ( {
imageProps={imageProps}
videoDuration={videoDuration}
/>
<Animated.View style={[hideOverlayViewOnLongPress? contentStyles:{}, ListStyles.content ]}>
<Animated.View style={[
hideOverlayViewOnLongPress ? contentStyles : {},
ListStyles.content,
]}
>
{imageOverlayView}
<Animated.View style={[contentStyles, ListStyles.content]}>
<Progress
active={isActive}
activeStory={activeStoryIndex}
progress={progress}
length={stories.length}
progressColor={progressColor}
progressActiveColor={progressActiveColor}
progressContainerStyle={progressContainerStyle}
/>
<StoryHeader {...props} />
<StoryContent stories={stories} active={isActive} activeStory={activeStory} />
</Animated.View>
<Animated.View style={[ contentStyles, ListStyles.content ]}>
<Progress
active={isActive}
activeStory={activeStoryIndex}
progress={progress}
length={stories.length}
progressColor={progressColor}
progressActiveColor={progressActiveColor}
progressContainerStyle={progressContainerStyle}
/>
<StoryHeader {...props} />
<StoryContent stories={stories} active={isActive} activeStory={activeStory} />
</Animated.View>
</Animated.View>
</Animated.View>
<StoryFooter stories={stories} active={isActive} activeStory={activeStory} />
Expand Down
1 change: 1 addition & 0 deletions src/core/dto/componentsDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface StoryModalProps {
imageProps?: ImageProps;
footerComponent?: ReactNode;
hideElementsOnLongPress?: boolean;
hideOverlayViewOnLongPress?: boolean;
loopingStories?: 'none' | 'all' | 'onlyLast';
statusBarTranslucent?: boolean;
onLoad: () => void;
Expand Down
1 change: 1 addition & 0 deletions src/core/dto/instagramStoriesDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export interface InstagramStoriesProps {
hideAvatarList?: boolean;
imageOverlayView?: ReactNode;
hideElementsOnLongPress?: boolean;
hideOverlayViewOnLongPress?: boolean;
loopingStories?: 'none' | 'all' | 'onlyLast';
statusBarTranslucent?: boolean;
onShow?: ( id: string ) => void;
Expand Down

0 comments on commit e230902

Please sign in to comment.