import * as React from 'react'; import { View, StyleSheet, ScrollView, Alert, Platform } from 'react-native'; import { Button, Appbar } from 'react-native-paper'; import { BlurView } from 'expo-blur'; import { MaterialCommunityIcons } from '@expo/vector-icons'; import { RouteProp, ParamListBase } from '@react-navigation/native'; import { createStackNavigator, StackNavigationProp, HeaderBackground, useHeaderHeight, } from '@react-navigation/stack'; import Article from '../Shared/Article'; import Albums from '../Shared/Albums'; type SimpleStackParams = { Article: { author: string }; Album: undefined; }; type SimpleStackNavigation = StackNavigationProp; const ArticleScreen = ({ navigation, route, }: { navigation: SimpleStackNavigation; route: RouteProp; }) => { return (
); }; const AlbumsScreen = ({ navigation, }: { navigation: SimpleStackNavigation; }) => { const headerHeight = useHeaderHeight(); return ( ); }; const SimpleStack = createStackNavigator(); type Props = Partial> & { navigation: StackNavigationProp; }; export default function SimpleStackScreen({ navigation, ...rest }: Props) { navigation.setOptions({ headerShown: false, }); return ( ({ title: `Article by ${route.params?.author}`, headerTintColor: '#fff', headerStyle: { backgroundColor: '#ff005d' }, headerBackTitleVisible: false, headerTitleAlign: 'center', headerBackImage: ({ tintColor }) => ( ), headerRight: ({ tintColor }) => ( Alert.alert( 'Never gonna give you up!', 'Never gonna let you down! Never gonna run around and desert you!' ) } /> ), })} initialParams={{ author: 'Gandalf' }} /> ( ), }} /> ); } const styles = StyleSheet.create({ buttons: { flexDirection: 'row', padding: 8, }, button: { margin: 8, }, });