Modern Food Delivery App UI Template
import React from 'react';
import {
StyleSheet,
Text,
View,
ScrollView,
TextInput,
Image,
TouchableOpacity,
FlatList,
StatusBar,
} from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { Ionicons, MaterialCommunityIcons, FontAwesome } from '@expo/vector-icons';
// Type definitions
type Category = {
id: string;
name: string;
image: string;
};
type Restaurant = {
id: string;
name: string;
cuisine: string;
rating: number;
deliveryCost: string;
deliveryTime: string;
image: string;
};
// Dummy data for categories
const categories: Category[] = [
{ id: '1', name: 'Pizza', image: 'https://images.unsplash.com/photo-1513104890138-7c749659a591?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D' },
{ id: '2', name: 'Burger', image: 'https://images.unsplash.com/photo-1568901346375-23c9450c58cd?q=80&w=3099&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D' },
{ id: '3', name: 'Sandwich', image: 'https://images.unsplash.com/photo-1540713434306-58505cf1b6fc?q=80&w=3087&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D' },
{ id: '4', name: 'Sushi', image: 'https://images.unsplash.com/photo-1579871494447-9811cf80d66c?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D' },
{ id: '5', name: 'Dessert', image: 'https://images.unsplash.com/photo-1551024506-0bccd828d307?q=80&w=2864&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D' },
];
// Dummy data for restaurants
const restaurants: Restaurant[] = [
{
id: '1',
name: 'Rose Garden Restaurant',
cuisine: 'Burger - Chicken - Rice - Wings',
rating: 4.7,
deliveryCost: 'Free',
deliveryTime: '20 min',
image: 'https://images.unsplash.com/photo-1650206383908-9187d5b4b133?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
},
{
id: '2',
name: 'Spicy Delight',
cuisine: 'Indian - Chinese',
rating: 4.5,
deliveryCost: '$2',
deliveryTime: '30 min',
image: 'https://images.unsplash.com/photo-1711014489632-0df21f53a499?q=80&w=3087&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
},
{
id: '3',
name: 'Green Leaf Cafe',
cuisine: 'Salads - Healthy',
rating: 4.8,
deliveryCost: 'Free',
deliveryTime: '25 min',
image: 'https://images.unsplash.com/photo-1558330405-11a1fbea293f?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
},
];
const App = () => {
return (
<SafeAreaView style={styles.safeArea}>
<StatusBar barStyle="dark-content" backgroundColor="#f8f8f8" />
<ScrollView style={styles.container} showsVerticalScrollIndicator={false}>
{/* Header Section */}
<View style={styles.header}>
<TouchableOpacity>
<Ionicons name="menu" size={28} color="black" />
</TouchableOpacity>
<View style={styles.deliveryInfo}>
<Text style={styles.deliveryText}>DELIVER TO</Text>
<View style={styles.locationContainer}>
<Text style={styles.locationText}>Sypyok office</Text>
<Ionicons name="chevron-down" size={16} color="black" style={styles.dropdownIcon} />
</View>
</View>
<TouchableOpacity style={styles.notificationIcon}>
<Ionicons name="basket-outline" size={28} color="black" />
<View style={styles.notificationBadge}>
<Text style={styles.notificationBadgeText}>2</Text>
</View>
</TouchableOpacity>
</View>
{/* Greeting Section */}
<Text style={[styles.greeting, {color: '#888', fontSize:20, fontWeight:'500', marginBottom:8,}]}>Hey Sypyok</Text>
<Text style={styles.greeting}>Good Afternoon! </Text>
{/* Search Bar */}
<View style={styles.searchContainer}>
<Ionicons name="search" size={24} color="#888" style={styles.searchIcon} />
<TextInput
style={styles.searchInput}
placeholder="Search dishes, restaurants"
placeholderTextColor="#888"
/>
</View>
{/* Categories Section */}
<View style={styles.sectionHeader}>
<Text style={styles.sectionTitle}>All Categories</Text>
<TouchableOpacity>
<Text style={styles.seeAllText}>See All <Ionicons name="chevron-forward" size={14} color="#FF6347" /></Text>
</TouchableOpacity>
</View>
<FlatList
horizontal
data={categories}
keyExtractor={(item) => item.id}
showsHorizontalScrollIndicator={false}
contentContainerStyle={styles.categoriesList}
renderItem={({ item }) => (
<TouchableOpacity style={styles.categoryCard}>
<Image source={{ uri: item.image }} style={styles.categoryImage} />
<Text style={styles.categoryName}>{item.name}</Text>
</TouchableOpacity>
)}
/>
{/* Open Restaurants Section */}
<View style={styles.sectionHeader}>
<Text style={styles.sectionTitle}>Open Restaurants</Text>
<TouchableOpacity>
<Text style={styles.seeAllText}>See All <Ionicons name="chevron-forward" size={14} color="#FF6347" /></Text>
</TouchableOpacity>
</View>
<View style={styles.restaurantsList}>
{restaurants.map((restaurant) => (
<TouchableOpacity key={restaurant.id} style={styles.restaurantCard}>
<Image source={{ uri: restaurant.image }} style={styles.restaurantImage} />
<View style={styles.restaurantDetails}>
<Text style={styles.restaurantName}>{restaurant.name}</Text>
<Text style={styles.restaurantCuisine}>{restaurant.cuisine}</Text>
<View style={styles.restaurantMeta}>
<View style={styles.metaItem}>
<FontAwesome name="star" size={14} color="#FFC300" />
<Text style={styles.metaText}>{restaurant.rating}</Text>
</View>
<View style={styles.metaItem}>
<MaterialCommunityIcons name="truck-delivery" size={16} color="#4CAF50" />
<Text style={styles.metaText}>{restaurant.deliveryCost}</Text>
</View>
<View style={styles.metaItem}>
<Ionicons name="time-outline" size={16} color="#FF6347" />
<Text style={styles.metaText}>{restaurant.deliveryTime}</Text>
</View>
</View>
</View>
</TouchableOpacity>
))}
</View>
</ScrollView>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
safeArea: {
flex: 1,
backgroundColor: '#f8f8f8',
},
container: {
flex: 1,
paddingHorizontal: 20,
},
header: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 20,
},
deliveryInfo: {
flex: 1, // Center the delivery info
alignItems: 'center',
},
deliveryText: {
fontSize: 12,
color: '#888',
marginBottom: 2,
},
locationContainer: {
flexDirection: 'row',
alignItems: 'center',
},
locationText: {
fontSize: 16,
fontWeight: 'bold',
color: 'black',
},
dropdownIcon: {
marginLeft: 5,
},
notificationIcon: {
position: 'relative',
},
notificationBadge: {
position: 'absolute',
top: -5,
right: -5,
backgroundColor: '#FF6347',
borderRadius: 10,
width: 20,
height: 20,
justifyContent: 'center',
alignItems: 'center',
},
notificationBadgeText: {
color: 'white',
fontSize: 12,
fontWeight: 'bold',
},
greeting: {
fontSize: 24,
fontWeight: 'bold',
marginBottom: 20,
color: 'black',
},
searchContainer: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: '#f0f0f0',
borderRadius: 15,
paddingHorizontal: 15,
marginBottom: 20,
height: 50,
},
searchIcon: {
marginRight: 10,
},
searchInput: {
flex: 1,
fontSize: 16,
color: 'black',
},
sectionHeader: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 15,
},
sectionTitle: {
fontSize: 18,
fontWeight: 'bold',
color: 'black',
},
seeAllText: {
fontSize: 14,
color: '#FF6347',
fontWeight: '600',
},
categoriesList: {
paddingBottom: 20,
},
categoryCard: {
backgroundColor: 'white',
borderRadius: 15,
padding: 10,
alignItems: 'center',
marginRight: 15,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.1,
shadowRadius: 4,
elevation: 3,
width: 100,
height: 120,
justifyContent: 'center',
},
categoryImage: {
width: 80,
height: 80,
borderRadius: 10,
marginBottom: 5,
},
categoryName: {
fontSize: 14,
fontWeight: 'bold',
color: 'black',
},
restaurantsList: {
marginBottom: 20,
},
restaurantCard: {
backgroundColor: 'white',
borderRadius: 15,
marginBottom: 15,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.1,
shadowRadius: 4,
elevation: 3,
overflow: 'hidden',
},
restaurantImage: {
width: '100%',
height: 180,
borderTopLeftRadius: 15,
borderTopRightRadius: 15,
resizeMode: 'cover',
},
restaurantDetails: {
padding: 15,
},
restaurantName: {
fontSize: 18,
fontWeight: 'bold',
marginBottom: 5,
color: 'black',
},
restaurantCuisine: {
fontSize: 14,
color: '#666',
marginBottom: 10,
},
restaurantMeta: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
metaItem: {
flexDirection: 'row',
alignItems: 'center',
},
metaText: {
marginLeft: 5,
fontSize: 14,
color: '#333',
},
});
export default App;
See More