Skip to content

Commit ea008c2

Browse files
authored
Merge pull request #4 from lukailun/develop
1.4.0
2 parents b3e9597 + fc0f256 commit ea008c2

File tree

12 files changed

+1546
-1116
lines changed

12 files changed

+1546
-1116
lines changed

.eslintrc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"@react-native",
5+
"plugin:@typescript-eslint/recommended",
6+
"prettier"
7+
],
8+
"parser": "@typescript-eslint/parser",
9+
"plugins": [
10+
"@typescript-eslint",
11+
"prettier"
12+
],
13+
"parserOptions": {
14+
"ecmaVersion": 2021,
15+
"sourceType": "module",
16+
"ecmaFeatures": {
17+
"jsx": true
18+
}
19+
},
20+
"rules": {
21+
"react/react-in-jsx-scope": "off",
22+
"prettier/prettier": [
23+
"error",
24+
{
25+
"quoteProps": "consistent",
26+
"singleQuote": true,
27+
"tabWidth": 2,
28+
"trailingComma": "es5",
29+
"useTabs": false
30+
}
31+
]
32+
}
33+
}

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"bracketSpacing": true,
9+
"arrowParens": "avoid"
10+
}

CHANGELOG.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11

22

3-
## [1.3.1](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.3.0...v1.3.1) (2025-01-21)
3+
# [1.4.0](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.3.1...v1.4.0) (2025-03-10)
44

55

66
### Bug Fixes
77

8-
* change navigation prop type to any ([33377cf](https://github.com/lukailun/react-native-animated-header-flat-list/commit/33377cfcbfd3822a118752a7e6963b646bf3b15c))
9-
* update navigation type ([889d916](https://github.com/lukailun/react-native-animated-header-flat-list/commit/889d91616cad6a1aac7134f79a7307a22800b65c))
8+
* use any type for navigation prop temporarily ([ef8c9b4](https://github.com/lukailun/react-native-animated-header-flat-list/commit/ef8c9b48c16a8beffd664e375c47576d5bb52cd0))
109

11-
# [1.3.0](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.2.3...v1.3.0) (2025-01-21)
10+
## [1.3.1](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.3.0...v1.3.1) (2025-01-21)
11+
12+
### Bug Fixes
13+
14+
- change navigation prop type to any ([33377cf](https://github.com/lukailun/react-native-animated-header-flat-list/commit/33377cfcbfd3822a118752a7e6963b646bf3b15c))
15+
- update navigation type ([889d916](https://github.com/lukailun/react-native-animated-header-flat-list/commit/889d91616cad6a1aac7134f79a7307a22800b65c))
1216

17+
# [1.3.0](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.2.3...v1.3.0) (2025-01-21)
1318

1419
### Features
1520

16-
* add navigationBarColor prop to support animated navigation bar background ([df2253e](https://github.com/lukailun/react-native-animated-header-flat-list/commit/df2253e8b27d9efcb0c7fabba334ab8ef6c72375))
21+
- add navigationBarColor prop to support animated navigation bar background ([df2253e](https://github.com/lukailun/react-native-animated-header-flat-list/commit/df2253e8b27d9efcb0c7fabba334ab8ef6c72375))
1722

1823
## [1.2.3](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.2.2...v1.2.3) (2024-12-06)
1924

20-
2125
### Bug Fixes
2226

23-
* remove redundant interpolation input range value ([fa99989](https://github.com/lukailun/react-native-animated-header-flat-list/commit/fa9998983ae4d2448fa60cb4a3318434753e812d))
27+
- remove redundant interpolation input range value ([fa99989](https://github.com/lukailun/react-native-animated-header-flat-list/commit/fa9998983ae4d2448fa60cb4a3318434753e812d))
2428

2529
## [1.2.2](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.2.1...v1.2.2) (2024-11-28)
2630

27-
2831
### Bug Fixes
2932

30-
* remove empty item ([26f970a](https://github.com/lukailun/react-native-animated-header-flat-list/commit/26f970aa1dfeb75f1e142db7d5e0a42482e6c402))
33+
- remove empty item ([26f970a](https://github.com/lukailun/react-native-animated-header-flat-list/commit/26f970aa1dfeb75f1e142db7d5e0a42482e6c402))
3134

3235
## [1.2.1](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.2.0...v1.2.1) (2024-11-28)
3336

34-
3537
### Bug Fixes
3638

37-
* show header item in empty list ([824a6ab](https://github.com/lukailun/react-native-animated-header-flat-list/commit/824a6ab5258a07b2af0658b338c6876be416b0c6))
39+
- show header item in empty list ([824a6ab](https://github.com/lukailun/react-native-animated-header-flat-list/commit/824a6ab5258a07b2af0658b338c6876be416b0c6))
3840

3941
# [1.2.0](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.1.1...v1.2.0) (2024-11-28)
4042

41-
4243
### Bug Fixes
4344

44-
* remove stickyHeaderHiddenOnScroll ([170fcd7](https://github.com/lukailun/react-native-animated-header-flat-list/commit/170fcd7317a29bdf7a2598d29ae7fcc843fccb67))
45-
45+
- remove stickyHeaderHiddenOnScroll ([170fcd7](https://github.com/lukailun/react-native-animated-header-flat-list/commit/170fcd7317a29bdf7a2598d29ae7fcc843fccb67))
4646

4747
### Features
4848

49-
* add parallax prop to control header background parallax effect ([9fa1b09](https://github.com/lukailun/react-native-animated-header-flat-list/commit/9fa1b09e603b766d7d2cc8a7706c1b5b6ef2b120))
50-
* add transparent status bar ([61714a8](https://github.com/lukailun/react-native-animated-header-flat-list/commit/61714a8050d51715f5fdcbcff996c2c1fa9e69f9))
49+
- add parallax prop to control header background parallax effect ([9fa1b09](https://github.com/lukailun/react-native-animated-header-flat-list/commit/9fa1b09e603b766d7d2cc8a7706c1b5b6ef2b120))
50+
- add transparent status bar ([61714a8](https://github.com/lukailun/react-native-animated-header-flat-list/commit/61714a8050d51715f5fdcbcff996c2c1fa9e69f9))
5151

5252
## [1.1.1](https://github.com/lukailun/react-native-animated-header-flat-list/compare/v1.1.0...v1.1.1) (2024-11-27)

CODE_OF_CONDUCT.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Contributor Covenant Code of Conduct
32

43
## Our Pledge
@@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
1817
Examples of behavior that contributes to a positive environment for our
1918
community include:
2019

21-
* Demonstrating empathy and kindness toward other people
22-
* Being respectful of differing opinions, viewpoints, and experiences
23-
* Giving and gracefully accepting constructive feedback
24-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2524
and learning from the experience
26-
* Focusing on what is best not just for us as individuals, but for the overall
25+
- Focusing on what is best not just for us as individuals, but for the overall
2726
community
2827

2928
Examples of unacceptable behavior include:
3029

31-
* The use of sexualized language or imagery, and sexual attention or advances of
30+
- The use of sexualized language or imagery, and sexual attention or advances of
3231
any kind
33-
* Trolling, insulting or derogatory comments, and personal or political attacks
34-
* Public or private harassment
35-
* Publishing others' private information, such as a physical or email address,
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email address,
3635
without their explicit permission
37-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3837
professional setting
3938

4039
## Enforcement Responsibilities

README.md

Lines changed: 34 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ CAUTION: `react-native-reanimated/plugin` has to be listed last.
7676

7777
```tsx
7878
import { useNavigation } from '@react-navigation/native';
79-
import { useCallback } from 'react';
8079
import { Image, ImageBackground, StyleSheet, Text, View } from 'react-native';
8180
import { AnimatedHeaderFlatList } from 'react-native-animated-header-flat-list';
8281

@@ -92,42 +91,32 @@ export default function HomeScreen() {
9291
'https://images.unsplash.com/photo-1579546929518-9e396f3cc809';
9392
const avatarUrl = 'https://api.dicebear.com/7.x/avataaars/png?seed=John';
9493

95-
const HeaderBackground = useCallback(
96-
() => (
97-
<ImageBackground
98-
source={{ uri: backgroundImageUrl }}
99-
style={styles.headerBackground}
100-
/>
101-
),
102-
[backgroundImageUrl]
94+
const HeaderBackground = () => (
95+
<ImageBackground
96+
source={{ uri: backgroundImageUrl }}
97+
style={styles.headerBackground}
98+
/>
10399
);
104100

105-
const HeaderContent = useCallback(
106-
() => (
107-
<View style={styles.headerContent}>
108-
<Image source={{ uri: avatarUrl }} style={styles.avatar} />
109-
</View>
110-
),
111-
[avatarUrl]
101+
const HeaderContent = () => (
102+
<View style={styles.headerContent}>
103+
<Image source={{ uri: avatarUrl }} style={styles.avatar} />
104+
</View>
112105
);
113106

114-
const StickyComponent = useCallback(
115-
() => <Text style={styles.stickyComponent}>Sticky Item</Text>,
116-
[]
107+
const StickyComponent = () => (
108+
<Text style={styles.stickyComponent}>Sticky Item</Text>
117109
);
118110

119-
const renderItem = useCallback(
120-
({
121-
item,
122-
}: {
123-
item: { id: string; title: string; description: string };
124-
}) => (
125-
<View style={styles.listItem}>
126-
<Text style={styles.itemTitle}>{item.title}</Text>
127-
<Text style={styles.itemDescription}>{item.description}</Text>
128-
</View>
129-
),
130-
[]
111+
const renderItem = ({
112+
item,
113+
}: {
114+
item: { id: string; title: string; description: string };
115+
}) => (
116+
<View style={styles.listItem}>
117+
<Text style={styles.itemTitle}>{item.title}</Text>
118+
<Text style={styles.itemDescription}>{item.description}</Text>
119+
</View>
131120
);
132121

133122
return (
@@ -205,18 +194,20 @@ const styles = StyleSheet.create({
205194

206195
### Props
207196

208-
| Prop | Type | Required | Description |
209-
| ---------------------- | -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
210-
| `navigation` | any | Yes | React Navigation navigation prop |
211-
| `title` | string | Yes | The title text that will animate between header and navigation bar |
212-
| `headerTitleStyle` | StyleProp<TextStyle> | No | Style object for the title in the header. Supports all Text style props. Position is relative to header container |
213-
| `navigationTitleStyle` | StyleProp<TextStyle> | No | Style object for the title in the navigation bar. Supports all Text style props except position-related properties |
214-
| `HeaderBackground` | React.ComponentType | Yes | Component to be rendered as the header background |
215-
| `HeaderContent` | React.ComponentType | No | Component to be rendered on top of the header background. Its opacity will automatically animate based on scroll position |
216-
| `StickyComponent` | React.ComponentType | No | Optional component that sticks below the navigation bar |
217-
| `parallax` | boolean | No | Enable/disable parallax effect for header background. Defaults to true |
218-
| `navigationBarColor` | ColorValue | No | Color of NavigationBar. Its opacity will automatically animate based on scroll position |
219-
| `...FlatListProps` | FlatListProps | - | All standard FlatList props are supported |
197+
| Prop | Type | Required | Description |
198+
| --------------------------- | -------------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
199+
| `navigation` | any | Yes | React Navigation navigation prop |
200+
| `title` | string | Yes | The title text that will animate between header and navigation bar |
201+
| `headerTitleStyle` | StyleProp<TextStyle> | No | Style object for the title in the header. Supports all Text style props. Position is relative to header container |
202+
| `navigationTitleStyle` | StyleProp<TextStyle> | No | Style object for the title in the navigation bar. Supports all Text style props except position-related properties |
203+
| `HeaderBackground` | React.ComponentType | Yes | Component to be rendered as the header background |
204+
| `HeaderContent` | React.ComponentType | No | Component to be rendered on top of the header background. Its opacity will automatically animate based on scroll position |
205+
| `StickyComponent` | React.ComponentType | No | Optional component that sticks below the navigation bar |
206+
| `parallax` | boolean | No | Enable/disable parallax effect for header background. Defaults to true |
207+
| `navigationBarColor` | ColorValue | No | Color of NavigationBar. Its opacity will automatically animate based on scroll position |
208+
| `navigationTitleTranslateX` | number | No | Horizontal offset for the navigation title position. Defaults to 0 |
209+
| `navigationTitleTranslateY` | number | No | Vertical offset for the navigation title position. Defaults to 0 |
210+
| `...FlatListProps` | FlatListProps | - | All standard FlatList props are supported |
220211

221212
## Contributing
222213

0 commit comments

Comments
 (0)