Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>CLIENT_ID</key>
<string>906784991953-aoq1tgiac6ge9aqv4kguai26265393h9.apps.googleusercontent.com</string>
<string>982053776531-0gqv0n84kjid9vtu00iq9drjvf9dvjhn.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.906784991953-aoq1tgiac6ge9aqv4kguai26265393h9</string>
<string>com.googleusercontent.apps.982053776531-0gqv0n84kjid9vtu00iq9drjvf9dvjhn</string>
<key>GOOGLE_APP_ID</key>
<string>1:982053776531:ios:eec4ee1692d95d2ce3b166</string>
</dict>
Expand Down
17 changes: 4 additions & 13 deletions app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,17 @@ export default function TabLayout() {
return (
<Tabs
screenOptions={{
tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
// Disable the static render of the header on web
// to prevent a hydration error in React Navigation v6.
headerShown: useClientOnlyValue(false, true),
//tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
// Force header to be completely hidden for all tabs
headerShown: false,
}}
>
<Tabs.Screen
name="index"
options={{
title: 'Home',
// We'll handle headers manually in each screen component
tabBarIcon: ({ color }: { color: string }) => <TabBarIcon name="code" color={color} />,
headerRight: () => (
<Link href="/modal" asChild>
<Pressable>
{({ pressed }) => (
<FontAwesome name="info-circle" size={25} color={Colors[colorScheme ?? 'light'].text} style={{ marginRight: 15, opacity: pressed ? 0.5 : 1 }} />
)}
</Pressable>
</Link>
),
}}
/>
<Tabs.Screen
Expand Down
60 changes: 31 additions & 29 deletions app/(tabs)/cellular.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
import { View, Text, StyleSheet } from "react-native";
import CellularDemo from "@/components/CellularDemo";
import { View, Text, StyleSheet } from 'react-native';
import CellularDemo from '@/components/CellularDemo';
import CustomHeader from '@/components/CustomHeader';

export default function SimplePage() {
return (
<View style={styles.container}>
<Text style={styles.header}>My Header</Text>
<Text style={styles.text}>
This is some example text to show a plain page component.
</Text>
<CellularDemo />
</View>
);
return (
<View style={{ flex: 1 }}>
<CustomHeader title="Cellular" />
<View style={styles.container}>
<Text style={styles.header}>My Header</Text>
<Text style={styles.text}>This is some example text to show a plain page component.</Text>
<CellularDemo />
</View>
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
padding: 16,
backgroundColor: "#121212",
},
header: {
fontSize: 24,
fontWeight: "bold",
color: "#fff",
marginBottom: 20,
},
text: {
fontSize: 16,
color: "#ccc",
textAlign: "center",
},
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 16,
backgroundColor: '#121212',
},
header: {
fontSize: 24,
fontWeight: 'bold',
color: '#fff',
marginBottom: 20,
},
text: {
fontSize: 16,
color: '#ccc',
textAlign: 'center',
},
});
Empty file added app/(tabs)/cellular.tsx.new
Empty file.
132 changes: 68 additions & 64 deletions app/(tabs)/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import LogViewer from '@/components/LogViewer';
import BatteryInfo from '@/components/BatteryInfo';
import { triggerLocalSampleNotification } from '@/utils/notifications.utils';
import { usePushNotifications } from '@/hooks/usePushNotifications';
import CustomHeader from '@/components/CustomHeader';

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

return (
<ScrollView contentContainerStyle={styles.scrollContent}>
<View style={styles.container}>
<Image source={require('../../assets/images/icon.png')} style={imgStyles.image} />
<View style={{ flex: 1 }}>
<CustomHeader title="Home" showModalButton={true} />
<ScrollView contentContainerStyle={styles.scrollContent}>
<View style={styles.container}>
<Image source={require('../../assets/images/icon.png')} style={imgStyles.image} />

<LogViewer />
<LogViewer />

{/* Battery information */}
<BatteryInfo />
{/* Battery information */}
<BatteryInfo />

{/* Location / Map */}
{loading ? (
<ActivityIndicator size="large" color="#007AFF" />
) : error ? (
<Text style={[styles.text, { color: textColor }]}>{error}</Text>
) : location && address ? (
<>
<Text style={[styles.text, { color: textColor }]}>
Address: {address.name}, {address.city}, {address.region}, {address.country}
</Text>
<Text style={[styles.text, { color: textColor }]}>
{location.coords.latitude} - {location.coords.longitude}
</Text>
{/* Location / Map */}
{loading ? (
<ActivityIndicator size="large" color="#007AFF" />
) : error ? (
<Text style={[styles.text, { color: textColor }]}>{error}</Text>
) : location && address ? (
<>
<Text style={[styles.text, { color: textColor }]}>
Address: {address.name}, {address.city}, {address.region}, {address.country}
</Text>
<Text style={[styles.text, { color: textColor }]}>
{location.coords.latitude} - {location.coords.longitude}
</Text>

<View style={styles.mapContainer}>
<MapView
style={styles.map}
region={
location
? {
latitude: location.coords.latitude,
longitude: location.coords.longitude,
latitudeDelta: 0.01,
longitudeDelta: 0.01,
}
: {
latitude: 37.7749, // Default to San Francisco
longitude: -122.4194,
latitudeDelta: 0.05,
longitudeDelta: 0.05,
}
}
showsUserLocation={true}
loadingEnabled={true}
>
{location && (
<Marker
coordinate={{
latitude: location.coords.latitude,
longitude: location.coords.longitude,
}}
title="You are here"
/>
)}
</MapView>
</View>
</>
) : (
<Text style={[styles.text, { color: textColor }]}>Waiting for location...</Text>
)}
<View style={styles.mapContainer}>
<MapView
style={styles.map}
region={
location
? {
latitude: location.coords.latitude,
longitude: location.coords.longitude,
latitudeDelta: 0.01,
longitudeDelta: 0.01,
}
: {
latitude: 37.7749, // Default to San Francisco
longitude: -122.4194,
latitudeDelta: 0.05,
longitudeDelta: 0.05,
}
}
showsUserLocation={true}
loadingEnabled={true}
>
{location && (
<Marker
coordinate={{
latitude: location.coords.latitude,
longitude: location.coords.longitude,
}}
title="You are here"
/>
)}
</MapView>
</View>
</>
) : (
<Text style={[styles.text, { color: textColor }]}>Waiting for location...</Text>
)}

<Button title="Get Location" onPress={fetchLocation} />
<Button title="Trigger Sample Notification" onPress={triggerLocalSampleNotification} />
<Button title="Get Location" onPress={fetchLocation} />
<Button title="Trigger Sample Notification" onPress={triggerLocalSampleNotification} />

{/* Link to Login page */}
<View style={{ marginTop: 12 }}>
<Link href="/login" asChild>
<Button title="Go to Login" />
</Link>
{/* Link to Login page */}
<View style={{ marginTop: 12 }}>
<Link href="/login" asChild>
<Button title="Go to Login" />
</Link>
</View>
</View>
</View>
</ScrollView>
</ScrollView>
</View>
);
}

Expand Down
Loading