diff options
| author | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-03-24 16:09:45 -0700 |
|---|---|---|
| committer | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-03-24 16:11:32 -0700 |
| commit | 8ce46790a8d12df6738d8ac17462ba57e2b0e6b9 (patch) | |
| tree | f58987fd342e466403bdbd00146a98189bd4fc4f /src/components/search/SearchBar.tsx | |
| parent | 592cb776068b2f1daf90755e04b33cdeba2bb947 (diff) | |
Cornell Changes
Diffstat (limited to 'src/components/search/SearchBar.tsx')
| -rw-r--r-- | src/components/search/SearchBar.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
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<SearchBarProps> = ({ 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 |
