diff --git a/README.md b/README.md index 7c76e12..8d42a46 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,7 @@ export default YourComponent; `avatarSource` | ImageProps['source'] | false `renderAvatar` | () => ReactNode | false `renderStoryHeader` | () => ReactNode | false + `onStoryHeaderPress` | () => void | false `name` | string | false `stories` | [StoryItemProps](#storyitemprops)[] | true diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 5d255a0..48b09b4 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -1,6 +1,7 @@ import React, { FC, memo } from 'react'; import { View, Text, Image, TouchableOpacity, + Pressable, } from 'react-native'; import { WIDTH } from '../../core/constants'; import HeaderStyles from './Header.styles'; @@ -9,7 +10,7 @@ import Close from '../Icon/close'; const StoryHeader: FC = ( { avatarSource, imgUrl, name, onClose, avatarSize, textStyle, closeColor, headerStyle, - headerContainerStyle, renderStoryHeader, + headerContainerStyle, renderStoryHeader, onStoryHeaderPress, } ) => { const styles = { width: avatarSize, height: avatarSize, borderRadius: avatarSize }; @@ -33,14 +34,14 @@ const StoryHeader: FC = ( { { width }, headerContainerStyle, ]} > - + onStoryHeaderPress?.()}> {( Boolean( avatarSource ) || Boolean( imgUrl ) ) && ( )} {Boolean( name ) && {name}} - + void; renderStoryHeader?: () => ReactNode; + onStoryHeaderPress?: () => void; } export interface IconProps { diff --git a/src/core/dto/instagramStoriesDTO.ts b/src/core/dto/instagramStoriesDTO.ts index d98c7e0..1ce157c 100644 --- a/src/core/dto/instagramStoriesDTO.ts +++ b/src/core/dto/instagramStoriesDTO.ts @@ -27,6 +27,7 @@ export interface InstagramStoryProps { avatarSource?: ImageProps['source']; renderAvatar?: () => ReactNode; renderStoryHeader?: () => ReactNode; + onStoryHeaderPress?: () => void; name?: string; stories: StoryItemProps[]; }