Skip to content

Commit ffbb99f

Browse files
committed
refactor: update props
1 parent 1381794 commit ffbb99f

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ You can find a set of detailed examples [here](https://github.com/kanelloc/react
4141

4242
# Props
4343

44-
| Prop name | Description | Type | Required |
45-
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------|---------------------|----------|
46-
| `TopNavBarComponent` | Rendered on top of the screen as a navbar when scrolling to the top | JSX.Element | true |
47-
| `HeaderComponent` | A component to use on top of header image. It can also be used without header image to render a custom component as header. | JSX.Element | false |
48-
| `OverflowNavbarComponent` | Rendered on top of the header. Transitions to TopNavbarComponent as you scroll | JSX.Element | false |
49-
| `headerMaxHeight` | Header maximum height. Default value is 300 | number | false |
50-
| `topBarHeight` | Height of the top navbar. Default value is 90 | number | false |
51-
| `headerImage` | Image header source | ImageSourcePropType | false |
52-
| `disableScale` | Disables header scaling when scrolling. Default value is false | boolean | false |
44+
| Prop name | Description | Type | Required |
45+
|-------------------------|-----------------------------------------------------------------------------------------------------------------------------|---------------------|----------|
46+
| `TopNavBarComponent` | Rendered on top of the screen as a navbar when scrolling to the top | JSX.Element | true |
47+
| `HeaderComponent` | A component to use on top of header image. It can also be used without header image to render a custom component as header. | JSX.Element | false |
48+
| `HeaderNavbarComponent` | Rendered on top of the header. Transitions to TopNavbarComponent as you scroll | JSX.Element | false |
49+
| `headerMaxHeight` | Height of the header (headerImage or HeaderComponent). Default value is 300 | number | false |
50+
| `topBarHeight` | Height of the top navbar. Default value is 90 | number | false |
51+
| `headerImage` | Image header source | ImageSourcePropType | false |
52+
| `disableScale` | Disables header scaling when scrolling. Default value is false | boolean | false |
5353

5454

5555

example/src/screens/ImageForegroundExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const ImageForegroundExample = () => {
99
<AnimatedScrollView
1010
HeaderComponent={<ForegroundComponent />}
1111
topBarHeight={isIOS ? 90 : 70}
12-
OverflowNavbarComponent={<OverflowHeaderComponent />}
12+
HeaderNavbarComponent={<OverflowHeaderComponent />}
1313
TopNavBarComponent={<Header />}
1414
headerImage={require('../../assets/cabin.jpg')}
1515
>

example/src/screens/OnlyForegroundExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const OnlyForegroundExample = () => {
1010
disableScale={true}
1111
HeaderComponent={<ForegroundComponent />}
1212
topBarHeight={isIOS ? 90 : 70}
13-
OverflowNavbarComponent={<OverflowHeaderComponent />}
13+
HeaderNavbarComponent={<OverflowHeaderComponent />}
1414
TopNavBarComponent={<Header />}
1515
>
1616
{data.map((e) => {

example/src/screens/OverflowHeaderExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const OverflowHeaderExample = () => {
88
<AnimatedScrollView
99
headerMaxHeight={400}
1010
topBarHeight={isIOS ? 90 : 70}
11-
OverflowNavbarComponent={<OverflowHeaderComponent />}
11+
HeaderNavbarComponent={<OverflowHeaderComponent />}
1212
TopNavBarComponent={<Header />}
1313
headerImage={require('../../assets/cabin.jpg')}
1414
>

example/src/screens/SafeAreaViewExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const SafeAreaViewExample = () => {
99
return (
1010
<SafeAreaView style={styles.container} edges={['bottom']}>
1111
<AnimatedScrollView
12-
OverflowNavbarComponent={<OverflowHeaderComponent />}
12+
HeaderNavbarComponent={<OverflowHeaderComponent />}
1313
TopNavBarComponent={<Header />}
1414
headerImage={require('../../assets/cabin.jpg')}
1515
>

src/components/AnimatedScrollView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { useAnimateScrollView } from '../hooks/useAnimateScrollView';
1313

1414
export const AnimatedScrollView = ({
1515
TopNavBarComponent,
16-
OverflowNavbarComponent,
16+
HeaderNavbarComponent,
1717
HeaderComponent,
1818
headerMaxHeight,
1919
topBarHeight,
@@ -104,7 +104,7 @@ export const AnimatedScrollView = ({
104104
headerHeight={headerNavHeight}
105105
scroll={scroll}
106106
imageHeight={imageHeight}
107-
OverflowHeaderComponent={OverflowNavbarComponent}
107+
OverflowHeaderComponent={HeaderNavbarComponent}
108108
HeaderComponent={TopNavBarComponent}
109109
/>
110110
</>

src/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface AnimatedScrollViewProps extends ScrollViewProps {
1616
/**
1717
* Rendered on top of the header. Transitions to TopNavbarComponent as you scroll
1818
*/
19-
OverflowNavbarComponent?: JSX.Element;
19+
HeaderNavbarComponent?: JSX.Element;
2020

2121
/**
2222
* Height of the header (headerImage or HeaderComponent). Default value is 300

0 commit comments

Comments
 (0)