From 8ce46790a8d12df6738d8ac17462ba57e2b0e6b9 Mon Sep 17 00:00:00 2001 From: ankit-thanekar007 Date: Wed, 24 Mar 2021 16:09:45 -0700 Subject: Cornell Changes --- src/components/search/SearchBar.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/components/search/SearchBar.tsx') diff --git a/src/components/search/SearchBar.tsx b/src/components/search/SearchBar.tsx index 62bda77e..5008ff53 100644 --- a/src/components/search/SearchBar.tsx +++ b/src/components/search/SearchBar.tsx @@ -14,6 +14,9 @@ import Animated, {interpolate} from 'react-native-reanimated'; import Icon from 'react-native-vector-icons/Feather'; import {normalize} from 'react-native-elements'; import {SCREEN_HEIGHT, getSearchSuggestions} from '../../utils'; +import {useSelector} from 'react-redux'; +import {RootState} from '../../store/rootReducer'; +import {Universities} from '../../types'; const AnimatedIcon = Animated.createAnimatedComponent(Icon); @@ -37,9 +40,12 @@ const SearchBar: React.FC = ({ e.preventDefault(); Keyboard.dismiss(); }; + const {profile: {university = Universities.cornell} = {}} = useSelector( + (state: RootState) => state.user, + ); const DEFAULT_PLACEHOLDER: string = 'Search'; // the list of suggestions to cycle through. TODO: get this from the backend - const SEARCH_SUGGESTIONS: string[] = getSearchSuggestions(); + const SEARCH_SUGGESTIONS: string[] = getSearchSuggestions(university); /* * index & id of current placeholder, used in selecting next placeholder. -1 * indicates DEFAULT_PLACEHOLDER. TODO: make it appear more random by tracking -- cgit v1.2.3-70-g09d2