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

Re-add SearchBar

parent 29c9e1fa
......@@ -10,9 +10,11 @@ type Props = {
onPress: () => void;
};
// Small display for showing the movies on the browsepage
const MovieCard = (props: Props) => {
return (
<TouchableNativeFeedback
<TouchableNativeFeedback
onPress={props.onPress}
>
<CardItem bordered style={styles.cardItem}>
......
......@@ -2,13 +2,11 @@ import { Container, Icon, Input, Item, View } from 'native-base';
import React, { Props, useEffect } from 'react';
import { NativeSyntheticEvent, TextInputChangeEventData, TextInputSubmitEditingEventData } from 'react-native';
import { useDispatch, useSelector } from 'react-redux';
import { useHistory } from 'react-router-native';
import { searchMovieTitles, searchMovies } from '../actions';
const SearchBar = () => {
const dispatch = useDispatch();
const history = useHistory();
const handleChange = (e: NativeSyntheticEvent<TextInputChangeEventData>): void => {
e.preventDefault();
......@@ -19,7 +17,6 @@ const SearchBar = () => {
const onSubmit = (e: NativeSyntheticEvent<TextInputSubmitEditingEventData>) => {
e.preventDefault();
dispatch(searchMovies(true)); // Perform search with current searchTerm
history.push('/');
}
return (
......
......@@ -8,6 +8,7 @@ import { searchMovies } from '../actions';
import { StackParamList } from '../components/App';
import MovieCard from '../components/MovieCard';
import PaginationButton from '../components/PaginationButton';
import SearchBar from '../components/SearchBar';
import { selectMoviesByAllIdsOrdering } from '../selectors/movieSelector';
type BrowseScreenNavigationProp = StackNavigationProp<StackParamList, 'Movie'>;
......@@ -43,6 +44,7 @@ const BrowsePage = ({navigation}: Props) => {
return (
<Content>
<SearchBar />
{determineRender()}
<PaginationButton />
</Content>
......
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