This repository has been archived by the owner on Jan 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
069476a
commit 602bcc5
Showing
4 changed files
with
128 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import * as React from 'react'; | ||
import { Animated, Image, TouchableOpacity } from 'react-native'; | ||
import { StackNavigationProp } from '@react-navigation/stack'; | ||
import { useCollapsibleBigHeader } from 'react-navigation-collapsible'; | ||
|
||
import { StackParamList } from '../App'; | ||
import { createRow } from './Row'; | ||
|
||
const data: number[] = []; | ||
for (let i = 0; i < 100; i++) { | ||
data.push(i); | ||
} | ||
|
||
type ScreenProps = { | ||
navigation: StackNavigationProp<StackParamList>; | ||
}; | ||
|
||
const BigHeaderScreen = ({ navigation }: ScreenProps) => { | ||
const { | ||
onScroll, | ||
containerPaddingTop, | ||
scrollIndicatorInsetTop, | ||
} = useCollapsibleBigHeader({ | ||
headerStyle: { | ||
height: 250, | ||
}, | ||
headerBackground: ( | ||
<TouchableOpacity style={{ flex: 1 }}> | ||
<Image | ||
source={{ | ||
uri: | ||
'https://artwork.wallartprints.com/media/catalog/category/mountain-pictures.jpg', | ||
}} | ||
style={{ flex: 1 }} | ||
/> | ||
</TouchableOpacity> | ||
), | ||
collapsedColor: 'white', | ||
}); | ||
|
||
return ( | ||
<Animated.FlatList | ||
data={data} | ||
onScroll={onScroll} | ||
contentContainerStyle={{ paddingTop: containerPaddingTop }} | ||
scrollIndicatorInsets={{ top: scrollIndicatorInsetTop }} | ||
renderItem={createRow(() => navigation.navigate('Detail'))} | ||
keyExtractor={(item: any) => item.toString()} | ||
/> | ||
); | ||
}; | ||
|
||
export { BigHeaderScreen }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters