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

Rename pages to screens #15

parent d1661799
import BrowsePage from '../pages/BrowsePage'; import BrowseScreen from '../pages/BrowseScreen';
import MoviePage from '../pages/MoviePage'; import MovieScreen from '../pages/MovieScreen';
import React from 'react'; import React from 'react';
import { View } from 'react-native'; import { View } from 'react-native';
import { useFonts } from 'expo-font'; import { useFonts } from 'expo-font';
...@@ -7,7 +7,7 @@ import { Ionicons } from '@expo/vector-icons'; ...@@ -7,7 +7,7 @@ import { Ionicons } from '@expo/vector-icons';
import { Container, Footer, Icon, Input, Item, Left, Text } from 'native-base'; import { Container, Footer, Icon, Input, Item, Left, Text } from 'native-base';
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'; import FilterPage from '../pages/FilterScreen';
export type StackParamList = { // The parameters for each screen export type StackParamList = { // The parameters for each screen
...@@ -33,8 +33,8 @@ const App = () => { ...@@ -33,8 +33,8 @@ const App = () => {
<NavigationContainer> <NavigationContainer>
<Container> <Container>
<Stack.Navigator initialRouteName='Browse'> <Stack.Navigator initialRouteName='Browse'>
<Stack.Screen name='Browse' component={BrowsePage} /> <Stack.Screen name='Browse' component={BrowseScreen} />
<Stack.Screen name='Movie' component={MoviePage} /> <Stack.Screen name='Movie' component={MovieScreen} />
<Stack.Screen name='Filter' component={FilterPage} /> <Stack.Screen name='Filter' component={FilterPage} />
</Stack.Navigator> </Stack.Navigator>
</Container> </Container>
......
...@@ -2,7 +2,7 @@ import { View, Button } from "native-base"; ...@@ -2,7 +2,7 @@ import { View, Button } from "native-base";
import React from "react"; import React from "react";
import SearchBar from "./SearchBar"; import SearchBar from "./SearchBar";
import { StyleSheet, Text } from 'react-native'; import { StyleSheet, Text } from 'react-native';
import { BrowseScreenProps } from "../pages/BrowsePage"; import { BrowseScreenProps } from "../pages/BrowseScreen";
// SearchBar and Filter Button combined // SearchBar and Filter Button combined
const Search = ({navigation}: BrowseScreenProps) => { const Search = ({navigation}: BrowseScreenProps) => {
......
...@@ -16,7 +16,7 @@ export type BrowseScreenProps = { ...@@ -16,7 +16,7 @@ export type BrowseScreenProps = {
}; };
// Main page. Displays different movies and the search bar // Main page. Displays different movies and the search bar
const BrowsePage = ({ navigation }: BrowseScreenProps) => { const BrowseScreen = ({ navigation }: BrowseScreenProps) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const movies = useSelector(selectMoviesByAllIdsOrdering); const movies = useSelector(selectMoviesByAllIdsOrdering);
const movieElements = Object.values(movies).map(( const movieElements = Object.values(movies).map((
...@@ -52,4 +52,4 @@ const BrowsePage = ({ navigation }: BrowseScreenProps) => { ...@@ -52,4 +52,4 @@ const BrowsePage = ({ navigation }: BrowseScreenProps) => {
); );
}; };
export default BrowsePage; export default BrowseScreen;
...@@ -20,7 +20,7 @@ type Props = { ...@@ -20,7 +20,7 @@ type Props = {
}; };
// Shows the different available filter options in its own page // Shows the different available filter options in its own page
const FilterPage = ({ navigation }: Props) => { const FilterScreen = ({ navigation }: Props) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
return ( return (
<View> <View>
...@@ -61,4 +61,4 @@ const styles = StyleSheet.create({ ...@@ -61,4 +61,4 @@ const styles = StyleSheet.create({
}, },
}); });
export default FilterPage; export default FilterScreen;
...@@ -15,7 +15,7 @@ type Props = { ...@@ -15,7 +15,7 @@ type Props = {
}; };
// Detailed page about a movie // Detailed page about a movie
const MoviePage = ({ route }: Props) => { const MovieScreen = ({ route }: Props) => {
const movie: Movie = useSelector( const movie: Movie = useSelector(
(state: RootState) => state.movies.byId[route.params.id] // Retrieves the current movie based on the navigation id (state: RootState) => state.movies.byId[route.params.id] // Retrieves the current movie based on the navigation id
); );
...@@ -53,4 +53,4 @@ const styles = StyleSheet.create({ ...@@ -53,4 +53,4 @@ const styles = StyleSheet.create({
}, },
}); });
export default MoviePage; export default MovieScreen;
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