- Simplified App.tsx with working UI showing demo lists - Fixed package.json with correct Expo SDK 54 versions - Fixed app.json config (removed invalid field) - Fixed metro.config.js to extend expo/metro-config - App ready for build test
122 lines
2.6 KiB
TypeScript
122 lines
2.6 KiB
TypeScript
import React from 'react';
|
|
import {
|
|
Text,
|
|
View,
|
|
StyleSheet,
|
|
SafeAreaView,
|
|
TouchableOpacity,
|
|
TextInput,
|
|
FlatList,
|
|
} from 'react-native';
|
|
|
|
const demoLists = [
|
|
{ id: '1', name: 'Groceries', itemCount: 5 },
|
|
{ id: '2', name: 'Hardware Store', itemCount: 3 },
|
|
{ id: '3', name: 'Pharmacy', itemCount: 2 },
|
|
];
|
|
|
|
export default function App() {
|
|
return (
|
|
<SafeAreaView style={styles.container}>
|
|
<View style={styles.header}>
|
|
<Text style={styles.title}>🛒 Bagsy</Text>
|
|
<Text style={styles.subtitle}>Your family shopping lists</Text>
|
|
</View>
|
|
|
|
<View style={styles.listsContainer}>
|
|
<Text style={styles.sectionTitle}>My Lists</Text>
|
|
|
|
{demoLists.map((list) => (
|
|
<TouchableOpacity key={list.id} style={styles.listCard}>
|
|
<Text style={styles.listName}>{list.name}</Text>
|
|
<Text style={styles.itemCount}>{list.itemCount} items</Text>
|
|
</TouchableOpacity>
|
|
))}
|
|
|
|
<TouchableOpacity style={styles.addButton}>
|
|
<Text style={styles.addButtonText}>+ Create New List</Text>
|
|
</TouchableOpacity>
|
|
</View>
|
|
|
|
<View style={styles.footer}>
|
|
<Text style={styles.footerText}>Tap a list to view items</Text>
|
|
</View>
|
|
</SafeAreaView>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: '#004E89',
|
|
},
|
|
header: {
|
|
padding: 20,
|
|
paddingTop: 40,
|
|
backgroundColor: '#FF6B35',
|
|
},
|
|
title: {
|
|
fontSize: 32,
|
|
fontWeight: 'bold',
|
|
color: '#fff',
|
|
},
|
|
subtitle: {
|
|
fontSize: 16,
|
|
color: '#fff',
|
|
opacity: 0.9,
|
|
},
|
|
listsContainer: {
|
|
flex: 1,
|
|
padding: 20,
|
|
},
|
|
sectionTitle: {
|
|
fontSize: 18,
|
|
fontWeight: '600',
|
|
color: '#1ABC9C',
|
|
marginBottom: 15,
|
|
},
|
|
listCard: {
|
|
backgroundColor: '#fff',
|
|
borderRadius: 12,
|
|
padding: 20,
|
|
marginBottom: 12,
|
|
flexDirection: 'row',
|
|
justifyContent: 'space-between',
|
|
alignItems: 'center',
|
|
shadowColor: '#000',
|
|
shadowOffset: { width: 0, height: 2 },
|
|
shadowOpacity: 0.1,
|
|
shadowRadius: 4,
|
|
elevation: 3,
|
|
},
|
|
listName: {
|
|
fontSize: 18,
|
|
fontWeight: '600',
|
|
color: '#333',
|
|
},
|
|
itemCount: {
|
|
fontSize: 14,
|
|
color: '#666',
|
|
},
|
|
addButton: {
|
|
backgroundColor: '#1ABC9C',
|
|
borderRadius: 12,
|
|
padding: 16,
|
|
alignItems: 'center',
|
|
marginTop: 10,
|
|
},
|
|
addButtonText: {
|
|
color: '#fff',
|
|
fontSize: 16,
|
|
fontWeight: '600',
|
|
},
|
|
footer: {
|
|
padding: 20,
|
|
backgroundColor: '#003d6e',
|
|
},
|
|
footerText: {
|
|
color: '#fff',
|
|
textAlign: 'center',
|
|
opacity: 0.7,
|
|
},
|
|
});
|