Skip to content

Commit b114467

Browse files
Merge pull request #5 from codebuilderinc/merge-nightly-workflow-and-global-error-and-new-login-screen
2 parents 18422d2 + df2bb90 commit b114467

File tree

17 files changed

+1246
-551
lines changed

17 files changed

+1246
-551
lines changed

app/(tabs)/_layout.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,17 @@ export default function TabLayout() {
1616
return (
1717
<Tabs
1818
screenOptions={{
19-
tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
20-
// Disable the static render of the header on web
21-
// to prevent a hydration error in React Navigation v6.
22-
headerShown: useClientOnlyValue(false, true),
19+
//tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
20+
// Force header to be completely hidden for all tabs
21+
headerShown: false,
2322
}}
2423
>
2524
<Tabs.Screen
2625
name="index"
2726
options={{
2827
title: 'Home',
28+
// We'll handle headers manually in each screen component
2929
tabBarIcon: ({ color }: { color: string }) => <TabBarIcon name="code" color={color} />,
30-
headerRight: () => (
31-
<Link href="/modal" asChild>
32-
<Pressable>
33-
{({ pressed }) => (
34-
<FontAwesome name="info-circle" size={25} color={Colors[colorScheme ?? 'light'].text} style={{ marginRight: 15, opacity: pressed ? 0.5 : 1 }} />
35-
)}
36-
</Pressable>
37-
</Link>
38-
),
3930
}}
4031
/>
4132
<Tabs.Screen

app/(tabs)/cellular.tsx

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
import { View, Text, StyleSheet } from "react-native";
2-
import CellularDemo from "@/components/CellularDemo";
1+
import { View, Text, StyleSheet } from 'react-native';
2+
import CellularDemo from '@/components/CellularDemo';
3+
import CustomHeader from '@/components/CustomHeader';
34

45
export default function SimplePage() {
5-
return (
6-
<View style={styles.container}>
7-
<Text style={styles.header}>My Header</Text>
8-
<Text style={styles.text}>
9-
This is some example text to show a plain page component.
10-
</Text>
11-
<CellularDemo />
12-
</View>
13-
);
6+
return (
7+
<View style={{ flex: 1 }}>
8+
<CustomHeader title="Cellular" />
9+
<View style={styles.container}>
10+
<Text style={styles.header}>My Header</Text>
11+
<Text style={styles.text}>This is some example text to show a plain page component.</Text>
12+
<CellularDemo />
13+
</View>
14+
</View>
15+
);
1416
}
1517

1618
const styles = StyleSheet.create({
17-
container: {
18-
flex: 1,
19-
justifyContent: "center",
20-
alignItems: "center",
21-
padding: 16,
22-
backgroundColor: "#121212",
23-
},
24-
header: {
25-
fontSize: 24,
26-
fontWeight: "bold",
27-
color: "#fff",
28-
marginBottom: 20,
29-
},
30-
text: {
31-
fontSize: 16,
32-
color: "#ccc",
33-
textAlign: "center",
34-
},
19+
container: {
20+
flex: 1,
21+
justifyContent: 'center',
22+
alignItems: 'center',
23+
padding: 16,
24+
backgroundColor: '#121212',
25+
},
26+
header: {
27+
fontSize: 24,
28+
fontWeight: 'bold',
29+
color: '#fff',
30+
marginBottom: 20,
31+
},
32+
text: {
33+
fontSize: 16,
34+
color: '#ccc',
35+
textAlign: 'center',
36+
},
3537
});

app/(tabs)/cellular.tsx.new

Whitespace-only changes.

app/(tabs)/index.tsx

Lines changed: 68 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import LogViewer from '@/components/LogViewer';
66
import BatteryInfo from '@/components/BatteryInfo';
77
import { triggerLocalSampleNotification } from '@/utils/notifications.utils';
88
import { usePushNotifications } from '@/hooks/usePushNotifications';
9+
import CustomHeader from '@/components/CustomHeader';
910

1011
export default function LocationComponent() {
1112
const { fcmToken } = usePushNotifications();
@@ -14,77 +15,80 @@ export default function LocationComponent() {
1415
const textColor = '#ffffff';
1516

1617
return (
17-
<ScrollView contentContainerStyle={styles.scrollContent}>
18-
<View style={styles.container}>
19-
<Image source={require('../../assets/images/icon.png')} style={imgStyles.image} />
18+
<View style={{ flex: 1 }}>
19+
<CustomHeader title="Home" showModalButton={true} />
20+
<ScrollView contentContainerStyle={styles.scrollContent}>
21+
<View style={styles.container}>
22+
<Image source={require('../../assets/images/icon.png')} style={imgStyles.image} />
2023

21-
<LogViewer />
24+
<LogViewer />
2225

23-
{/* Battery information */}
24-
<BatteryInfo />
26+
{/* Battery information */}
27+
<BatteryInfo />
2528

26-
{/* Location / Map */}
27-
{loading ? (
28-
<ActivityIndicator size="large" color="#007AFF" />
29-
) : error ? (
30-
<Text style={[styles.text, { color: textColor }]}>{error}</Text>
31-
) : location && address ? (
32-
<>
33-
<Text style={[styles.text, { color: textColor }]}>
34-
Address: {address.name}, {address.city}, {address.region}, {address.country}
35-
</Text>
36-
<Text style={[styles.text, { color: textColor }]}>
37-
{location.coords.latitude} - {location.coords.longitude}
38-
</Text>
29+
{/* Location / Map */}
30+
{loading ? (
31+
<ActivityIndicator size="large" color="#007AFF" />
32+
) : error ? (
33+
<Text style={[styles.text, { color: textColor }]}>{error}</Text>
34+
) : location && address ? (
35+
<>
36+
<Text style={[styles.text, { color: textColor }]}>
37+
Address: {address.name}, {address.city}, {address.region}, {address.country}
38+
</Text>
39+
<Text style={[styles.text, { color: textColor }]}>
40+
{location.coords.latitude} - {location.coords.longitude}
41+
</Text>
3942

40-
<View style={styles.mapContainer}>
41-
<MapView
42-
style={styles.map}
43-
region={
44-
location
45-
? {
46-
latitude: location.coords.latitude,
47-
longitude: location.coords.longitude,
48-
latitudeDelta: 0.01,
49-
longitudeDelta: 0.01,
50-
}
51-
: {
52-
latitude: 37.7749, // Default to San Francisco
53-
longitude: -122.4194,
54-
latitudeDelta: 0.05,
55-
longitudeDelta: 0.05,
56-
}
57-
}
58-
showsUserLocation={true}
59-
loadingEnabled={true}
60-
>
61-
{location && (
62-
<Marker
63-
coordinate={{
64-
latitude: location.coords.latitude,
65-
longitude: location.coords.longitude,
66-
}}
67-
title="You are here"
68-
/>
69-
)}
70-
</MapView>
71-
</View>
72-
</>
73-
) : (
74-
<Text style={[styles.text, { color: textColor }]}>Waiting for location...</Text>
75-
)}
43+
<View style={styles.mapContainer}>
44+
<MapView
45+
style={styles.map}
46+
region={
47+
location
48+
? {
49+
latitude: location.coords.latitude,
50+
longitude: location.coords.longitude,
51+
latitudeDelta: 0.01,
52+
longitudeDelta: 0.01,
53+
}
54+
: {
55+
latitude: 37.7749, // Default to San Francisco
56+
longitude: -122.4194,
57+
latitudeDelta: 0.05,
58+
longitudeDelta: 0.05,
59+
}
60+
}
61+
showsUserLocation={true}
62+
loadingEnabled={true}
63+
>
64+
{location && (
65+
<Marker
66+
coordinate={{
67+
latitude: location.coords.latitude,
68+
longitude: location.coords.longitude,
69+
}}
70+
title="You are here"
71+
/>
72+
)}
73+
</MapView>
74+
</View>
75+
</>
76+
) : (
77+
<Text style={[styles.text, { color: textColor }]}>Waiting for location...</Text>
78+
)}
7679

77-
<Button title="Get Location" onPress={fetchLocation} />
78-
<Button title="Trigger Sample Notification" onPress={triggerLocalSampleNotification} />
80+
<Button title="Get Location" onPress={fetchLocation} />
81+
<Button title="Trigger Sample Notification" onPress={triggerLocalSampleNotification} />
7982

80-
{/* Link to Login page */}
81-
<View style={{ marginTop: 12 }}>
82-
<Link href="/login" asChild>
83-
<Button title="Go to Login" />
84-
</Link>
83+
{/* Link to Login page */}
84+
<View style={{ marginTop: 12 }}>
85+
<Link href="/login" asChild>
86+
<Button title="Go to Login" />
87+
</Link>
88+
</View>
8589
</View>
86-
</View>
87-
</ScrollView>
90+
</ScrollView>
91+
</View>
8892
);
8993
}
9094

0 commit comments

Comments
 (0)