Commit f151469a authored by Thor-Herman's avatar Thor-Herman
Browse files

Create FilterPage and route #7 #12

parent 504590b8
......@@ -10,11 +10,13 @@ import SearchBar from './SearchBar';
import Header from './Header';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import FilterPage from '../pages/FilterPage';
export type StackParamList = {
Browse: undefined;
Movie: { id: number };
Filter: undefined,
};
const Stack = createStackNavigator<StackParamList>();
......@@ -35,6 +37,7 @@ const App = () => {
<Stack.Navigator initialRouteName='Browse'>
<Stack.Screen name='Browse' component={BrowsePage} />
<Stack.Screen name='Movie' component={MoviePage} />
<Stack.Screen name='Filter' component={FilterPage} />
</Stack.Navigator>
</Container>
</NavigationContainer>
......
......@@ -11,7 +11,7 @@ import PaginationButton from '../components/PaginationButton';
import SearchBar from '../components/SearchBar';
import { selectMoviesByAllIdsOrdering } from '../selectors/movieSelector';
type BrowseScreenNavigationProp = StackNavigationProp<StackParamList, 'Movie'>;
type BrowseScreenNavigationProp = StackNavigationProp<StackParamList, 'Browse'>;
type Props = {
navigation: BrowseScreenNavigationProp;
};
......@@ -44,7 +44,12 @@ const BrowsePage = ({navigation}: Props) => {
return (
<Content>
<View>
<SearchBar />
<Button onPress={() => navigation.navigate('Filter')}>
<Text>Filter</Text>
</Button>
</View>
{determineRender()}
<PaginationButton />
</Content>
......
import React from "react";
import { Text } from "native-base";
import { StackParamList } from "../components/App";
import { StackNavigationProp } from '@react-navigation/stack';
type FilterScreenNavigationProp = StackNavigationProp<StackParamList, 'Filter'>;
type Props = {
navigation: FilterScreenNavigationProp;
};
const FilterPage = ({navigation}: Props) => {
return <Text>FilterPage</Text>;
};
export default FilterPage;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment