v0.1.2: theme Favorites screen (dark mode); versionCode 2
Some checks failed
build-apk / build (push) Failing after 1h1m11s
Some checks failed
build-apk / build (push) Failing after 1h1m11s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
5d269bf2a3
commit
870da6f432
2 changed files with 14 additions and 11 deletions
|
|
@ -3,13 +3,14 @@
|
||||||
"name": "BigBrainParking",
|
"name": "BigBrainParking",
|
||||||
"slug": "bigbrainparking",
|
"slug": "bigbrainparking",
|
||||||
"scheme": "bigbrainparking",
|
"scheme": "bigbrainparking",
|
||||||
"version": "0.1.1",
|
"version": "0.1.2",
|
||||||
"orientation": "portrait",
|
"orientation": "portrait",
|
||||||
"userInterfaceStyle": "automatic",
|
"userInterfaceStyle": "automatic",
|
||||||
"newArchEnabled": true,
|
"newArchEnabled": true,
|
||||||
"icon": "./assets/icon.png",
|
"icon": "./assets/icon.png",
|
||||||
"android": {
|
"android": {
|
||||||
"package": "top.mowden.bigbrainparking",
|
"package": "top.mowden.bigbrainparking",
|
||||||
|
"versionCode": 2,
|
||||||
"edgeToEdgeEnabled": true,
|
"edgeToEdgeEnabled": true,
|
||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
"foregroundImage": "./assets/adaptive-icon.png",
|
"foregroundImage": "./assets/adaptive-icon.png",
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { FlatList, StyleSheet, Text, TouchableOpacity, View } from 'react-native
|
||||||
import { useFocusEffect, useNavigation } from '@react-navigation/native';
|
import { useFocusEffect, useNavigation } from '@react-navigation/native';
|
||||||
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
||||||
import { ps } from '@/api/client';
|
import { ps } from '@/api/client';
|
||||||
|
import { useTheme } from '@/theme/ThemeContext';
|
||||||
import {
|
import {
|
||||||
listKiosks,
|
listKiosks,
|
||||||
removeKiosk,
|
removeKiosk,
|
||||||
|
|
@ -15,6 +16,7 @@ type Nav = NativeStackNavigationProp<RootStackParamList>;
|
||||||
|
|
||||||
export function FavoritesScreen() {
|
export function FavoritesScreen() {
|
||||||
const navigation = useNavigation<Nav>();
|
const navigation = useNavigation<Nav>();
|
||||||
|
const { colors } = useTheme();
|
||||||
const [items, setItems] = useState<SavedKiosk[]>([]);
|
const [items, setItems] = useState<SavedKiosk[]>([]);
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
|
|
@ -38,27 +40,28 @@ export function FavoritesScreen() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FlatList
|
<FlatList
|
||||||
|
style={{ backgroundColor: colors.bg }}
|
||||||
contentContainerStyle={{ padding: 16 }}
|
contentContainerStyle={{ padding: 16 }}
|
||||||
data={items}
|
data={items}
|
||||||
keyExtractor={(k) => k.key}
|
keyExtractor={(k) => k.key}
|
||||||
ListEmptyComponent={
|
ListEmptyComponent={
|
||||||
<Text style={styles.empty}>
|
<Text style={[styles.empty, { color: colors.subtext }]}>
|
||||||
No saved kiosks yet. Scan a kiosk QR and tap “Save kiosk”.
|
No saved kiosks yet. Scan a kiosk QR and tap “Save kiosk”.
|
||||||
</Text>
|
</Text>
|
||||||
}
|
}
|
||||||
renderItem={({ item }) => (
|
renderItem={({ item }) => (
|
||||||
<View style={styles.card}>
|
<View style={[styles.card, { backgroundColor: colors.card }]}>
|
||||||
<TouchableOpacity style={{ flex: 1 }} onPress={() => open(item)}>
|
<TouchableOpacity style={{ flex: 1 }} onPress={() => open(item)}>
|
||||||
<Text style={styles.name}>{item.zoneName ?? item.key}</Text>
|
<Text style={[styles.name, { color: colors.text }]}>{item.zoneName ?? item.key}</Text>
|
||||||
<Text style={styles.meta}>
|
<Text style={[styles.meta, { color: colors.subtext }]}>
|
||||||
{item.scannerCode ? `Code ${item.scannerCode}` : `Serial ${item.terminalSerNo}`}
|
{item.scannerCode ? `Code ${item.scannerCode}` : `Serial ${item.terminalSerNo}`}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity style={styles.action} onPress={() => shareKiosk(item)}>
|
<TouchableOpacity style={styles.action} onPress={() => shareKiosk(item)}>
|
||||||
<Text style={styles.actionText}>Share</Text>
|
<Text style={[styles.actionText, { color: colors.primary }]}>Share</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity style={styles.action} onPress={() => remove(item)}>
|
<TouchableOpacity style={styles.action} onPress={() => remove(item)}>
|
||||||
<Text style={[styles.actionText, { color: '#c0392b' }]}>Remove</Text>
|
<Text style={[styles.actionText, { color: colors.danger }]}>Remove</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
@ -67,18 +70,17 @@ export function FavoritesScreen() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
empty: { color: '#888', textAlign: 'center', marginTop: 48 },
|
empty: { textAlign: 'center', marginTop: 48 },
|
||||||
card: {
|
card: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
backgroundColor: '#f4f4f4',
|
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
padding: 14,
|
padding: 14,
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
gap: 10,
|
gap: 10,
|
||||||
},
|
},
|
||||||
name: { fontSize: 16, fontWeight: '600' },
|
name: { fontSize: 16, fontWeight: '600' },
|
||||||
meta: { color: '#777', fontSize: 12, marginTop: 2 },
|
meta: { fontSize: 12, marginTop: 2 },
|
||||||
action: { paddingHorizontal: 6, paddingVertical: 4 },
|
action: { paddingHorizontal: 6, paddingVertical: 4 },
|
||||||
actionText: { color: '#1e6f5c', fontWeight: '600' },
|
actionText: { fontWeight: '600' },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue