-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: venue search using wildcards (#84)
- Loading branch information
Showing
9 changed files
with
177 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { useNavigation } from "@react-navigation/native"; | ||
import React from "react"; | ||
import { TouchableOpacity } from "react-native"; | ||
import { View, Text, Image, StyleSheet } from "react-native"; | ||
|
||
export type VenuePreview = { | ||
venue_id: string; | ||
name: string; | ||
address: string; | ||
city: string; | ||
state: string; | ||
zip_code: string; | ||
venue_type: string; | ||
total_rating: number; | ||
price: number; | ||
} | ||
|
||
type EventCardProps = { | ||
venue_preview: VenuePreview; | ||
}; | ||
|
||
export const VenueCard = ({ venue_preview }: EventCardProps) => { | ||
|
||
const navigation = useNavigation(); | ||
const venue_id = venue_preview.venue_id; | ||
|
||
return ( | ||
<TouchableOpacity onPress={() => navigation.navigate("Venue", { venue_id })}> | ||
<View style={styles.card}> | ||
<Image source={{ uri: "https://visitturkey.in/wp-content/uploads/2024/07/izmir-nightlife-bars-clubs-and-lounges-1200x900.webp" }} style={styles.image} /> | ||
<View style={styles.cardContent}> | ||
<Text style={styles.eventTitle}>{venue_preview.name}</Text> | ||
<Text style={styles.eventDateTime}>{venue_preview.address}</Text> | ||
<Text style={styles.eventDateTime}>{venue_preview.city}, {venue_preview.state} {venue_preview.zip_code}</Text> | ||
<Text style={styles.eventDateTime}>{venue_preview.venue_type} Rating: {venue_preview.total_rating} Price: {venue_preview.price}</Text> | ||
</View> | ||
</View> | ||
</TouchableOpacity> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
card: { | ||
backgroundColor: "#2d2d44", | ||
borderRadius: 10, | ||
overflow: "hidden", | ||
marginRight: 10, | ||
width: "auto", | ||
height: "auto", | ||
borderWidth: 2, | ||
borderColor: "#735ad1", | ||
marginVertical: 6, | ||
padding: 0 | ||
}, | ||
image: { | ||
width: "100%", | ||
aspectRatio: 16 / 9, | ||
}, | ||
cardContent: { | ||
padding: 10, | ||
height: "auto" | ||
}, | ||
eventTitle: { | ||
fontSize: 14, | ||
fontWeight: "bold", | ||
color: "#fff", | ||
}, | ||
eventDateTime: { | ||
fontSize: 14, | ||
color: "#ffffff", | ||
marginTop: 5, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from "react"; | ||
import { FlatList, StyleSheet, View, Text, TouchableOpacity } from "react-native"; | ||
import { VenueCard, VenuePreview } from "@/screens/explore/VenueCard"; | ||
import { useNavigation, useRoute } from "@react-navigation/native"; | ||
|
||
type VenueCardPageProps = { | ||
venues: VenuePreview[]; | ||
}; | ||
|
||
const VenueCardPage: React.FC<VenueCardPageProps> = () => { | ||
|
||
const route = useRoute(); | ||
|
||
const venues: VenuePreview[] = route.params?.venues || []; | ||
|
||
console.log(venues); | ||
|
||
const navigation = useNavigation(); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<TouchableOpacity onPress={() => navigation.goBack()} style={{ display: "flex", borderColor: "gray", borderWidth: 2, borderRadius: 6, marginBottom: 4, marginHorizontal: 12}}> | ||
<Text style={{ color: "#fff", padding: 10, marginLeft: 10 }}>Back</Text> | ||
</TouchableOpacity> | ||
<FlatList | ||
data={venues} | ||
renderItem={({ item }) => <VenueCard venue_preview={item} />} | ||
keyExtractor={(item) => item.venue_id} | ||
horizontal={false} | ||
showsHorizontalScrollIndicator={false} | ||
contentContainerStyle={styles.listContent} | ||
style={{ flex: 1, marginTop: 10 }} | ||
/> | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
title: { | ||
fontSize: 24, | ||
color: "#fff", | ||
fontFamily: "Archivo_700Bold", | ||
marginLeft: 10, | ||
marginBottom: 10, | ||
padding: 10 | ||
}, | ||
container: { | ||
flex: 1, | ||
backgroundColor: "#1c1c1e", | ||
paddingVertical: 10, | ||
}, | ||
listContent: { | ||
paddingHorizontal: 10, | ||
}, | ||
}); | ||
|
||
export default VenueCardPage; |