Skip to content

Commit

Permalink
add algolia logo on search results as we use it to improve them
Browse files Browse the repository at this point in the history
  • Loading branch information
AkselsLedins committed Jul 24, 2019
1 parent 40e912f commit d19e16b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 22 deletions.
Binary file added src/assets/images/algolia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 33 additions & 20 deletions src/components/SearchLocation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ActivityIndicator,
Platform,
AsyncStorage,
Image,
} from 'react-native';
import { Location, Haptic } from 'expo';
import Sentry from 'sentry-expo';
Expand Down Expand Up @@ -147,6 +148,16 @@ class SearchLocation extends Component {
return (
<View>
{/* user input */}
<TouchableOpacity style={styles.item}>
<Text>
Résultats améliorés par
<Image
source={require('../../assets/images/algolia.png')}
style={{ maxHeight: 20, maxWidth: 100 }}
resizeMode="contain"
/>
</Text>
</TouchableOpacity>
<View style={{ display: 'flex', flexDirection: 'row' }}>
<TextInput
style={styles.input}
Expand Down Expand Up @@ -182,7 +193,7 @@ class SearchLocation extends Component {
renderItem={() => <Text style={styles.item}>Aucun résultat (╯°□°)╯︵ ┻━┻</Text>}
/>
)}
{history.length > 0 && (
{!hasSearched && history.length > 0 && (
<FlatList
keyboardShouldPersistTaps="always"
keyExtractor={item => `${item.name}${item.lat}${item.lng}`}
Expand All @@ -205,25 +216,27 @@ class SearchLocation extends Component {
/>
)}
{data.length > 0 && (
<FlatList
keyboardShouldPersistTaps="always"
keyExtractor={item => `${item.name}${item.lat}${item.lng}`}
data={data}
style={{ backgroundColor: '#FFF' }}
renderItem={({ item }) => (
<TouchableOpacity
style={styles.item}
onPress={() =>
this.select({
lat: item.lat,
lng: item.lng,
text: item.name,
})
}>
<Text>{item.name}</Text>
</TouchableOpacity>
)}
/>
<>
<FlatList
keyboardShouldPersistTaps="always"
keyExtractor={item => `${item.name}${item.lat}${item.lng}`}
data={data}
style={{ backgroundColor: '#FFF' }}
renderItem={({ item }) => (
<TouchableOpacity
style={styles.item}
onPress={() =>
this.select({
lat: item.lat,
lng: item.lng,
text: item.name,
})
}>
<Text>{item.name}</Text>
</TouchableOpacity>
)}
/>
</>
)}
</View>
</View>
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8000,9 +8000,9 @@ xcode@^0.9.1:
simple-plist "^0.2.1"
uuid "3.0.1"

"xcode@git+https://github.com/apache/cordova-node-xcode.git#e7646f0680d509b590b839e567c217590451505b":
"xcode@https://github.com/apache/cordova-node-xcode#e7646f0680d509b590b839e567c217590451505b":
version "1.0.1-dev"
resolved "git+https://github.com/apache/cordova-node-xcode.git#e7646f0680d509b590b839e567c217590451505b"
resolved "https://github.com/apache/cordova-node-xcode#e7646f0680d509b590b839e567c217590451505b"
dependencies:
simple-plist "^0.2.1"
uuid "3.0.1"
Expand Down

0 comments on commit d19e16b

Please sign in to comment.