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'; ...@@ -10,11 +10,13 @@ import SearchBar from './SearchBar';
import Header from './Header'; import Header from './Header';
import { createStackNavigator } from '@react-navigation/stack'; import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native'; import { NavigationContainer } from '@react-navigation/native';
import FilterPage from '../pages/FilterPage';
export type StackParamList = { export type StackParamList = {
Browse: undefined; Browse: undefined;
Movie: { id: number }; Movie: { id: number };
Filter: undefined,
}; };
const Stack = createStackNavigator<StackParamList>(); const Stack = createStackNavigator<StackParamList>();
...@@ -35,6 +37,7 @@ const App = () => { ...@@ -35,6 +37,7 @@ const App = () => {
<Stack.Navigator initialRouteName='Browse'> <Stack.Navigator initialRouteName='Browse'>
<Stack.Screen name='Browse' component={BrowsePage} /> <Stack.Screen name='Browse' component={BrowsePage} />
<Stack.Screen name='Movie' component={MoviePage} /> <Stack.Screen name='Movie' component={MoviePage} />
<Stack.Screen name='Filter' component={FilterPage} />
</Stack.Navigator> </Stack.Navigator>
</Container> </Container>
</NavigationContainer> </NavigationContainer>
......
...@@ -11,7 +11,7 @@ import PaginationButton from '../components/PaginationButton'; ...@@ -11,7 +11,7 @@ import PaginationButton from '../components/PaginationButton';
import SearchBar from '../components/SearchBar'; import SearchBar from '../components/SearchBar';
import { selectMoviesByAllIdsOrdering } from '../selectors/movieSelector'; import { selectMoviesByAllIdsOrdering } from '../selectors/movieSelector';
type BrowseScreenNavigationProp = StackNavigationProp<StackParamList, 'Movie'>; type BrowseScreenNavigationProp = StackNavigationProp<StackParamList, 'Browse'>;
type Props = { type Props = {
navigation: BrowseScreenNavigationProp; navigation: BrowseScreenNavigationProp;
}; };
...@@ -44,7 +44,12 @@ const BrowsePage = ({navigation}: Props) => { ...@@ -44,7 +44,12 @@ const BrowsePage = ({navigation}: Props) => {
return ( return (
<Content> <Content>
<View>
<SearchBar /> <SearchBar />
<Button onPress={() => navigation.navigate('Filter')}>
<Text>Filter</Text>
</Button>
</View>
{determineRender()} {determineRender()}
<PaginationButton /> <PaginationButton />
</Content> </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