aboutsummaryrefslogtreecommitdiff
path: root/src/components/search/SearchBar.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-26 22:40:00 -0400
committerIvan Chen <ivan@tagg.id>2021-03-26 22:40:00 -0400
commit64785e6527e521ce14e32edcc80adc6253b48657 (patch)
treedf42bdbe6810b589ec52c98fcd622cc7e2864879 /src/components/search/SearchBar.tsx
parented26661062a2e47df2662254eaddfcfa1de62d04 (diff)
renamed to UniversityType, applied to all
Diffstat (limited to 'src/components/search/SearchBar.tsx')
-rw-r--r--src/components/search/SearchBar.tsx21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/components/search/SearchBar.tsx b/src/components/search/SearchBar.tsx
index 5008ff53..4824b56f 100644
--- a/src/components/search/SearchBar.tsx
+++ b/src/components/search/SearchBar.tsx
@@ -1,22 +1,21 @@
-import React, {useState, useEffect} from 'react';
+import React, {useEffect, useState} from 'react';
import {
+ Keyboard,
+ NativeSyntheticEvent,
StyleSheet,
- TextInput,
- TouchableOpacity,
Text,
- View,
+ TextInput,
TextInputProps,
- Keyboard,
- NativeSyntheticEvent,
TextInputSubmitEditingEventData,
+ TouchableOpacity,
+ View,
} from 'react-native';
+import {normalize} from 'react-native-elements';
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';
+import {getSearchSuggestions, SCREEN_HEIGHT} from '../../utils';
const AnimatedIcon = Animated.createAnimatedComponent(Icon);
@@ -40,9 +39,7 @@ const SearchBar: React.FC<SearchBarProps> = ({
e.preventDefault();
Keyboard.dismiss();
};
- const {profile: {university = Universities.cornell} = {}} = useSelector(
- (state: RootState) => state.user,
- );
+ const {university} = useSelector((state: RootState) => state.user.profile);
const DEFAULT_PLACEHOLDER: string = 'Search';
// the list of suggestions to cycle through. TODO: get this from the backend
const SEARCH_SUGGESTIONS: string[] = getSearchSuggestions(university);