diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx new file mode 100644 index 0000000..0de8fcf --- /dev/null +++ b/app/(tabs)/_layout.tsx @@ -0,0 +1,15 @@ +import { StatusBar, StyleSheet, Text, View } from "react-native"; +import React from "react"; +import { Stack } from "expo-router"; + +const TabsLayout = () => { + return ( + + + + ); +}; + +export default TabsLayout; + +const styles = StyleSheet.create({}); diff --git a/app/StayIndex.tsx b/app/(tabs)/stays/StayIndex.tsx similarity index 100% rename from app/StayIndex.tsx rename to app/(tabs)/stays/StayIndex.tsx diff --git a/app/Staydetails.tsx b/app/(tabs)/stays/Staydetails.tsx similarity index 100% rename from app/Staydetails.tsx rename to app/(tabs)/stays/Staydetails.tsx diff --git a/app/(tabs)/stays/_layout.tsx b/app/(tabs)/stays/_layout.tsx new file mode 100644 index 0000000..032647f --- /dev/null +++ b/app/(tabs)/stays/_layout.tsx @@ -0,0 +1,12 @@ +import { Stack } from "expo-router"; +import { Button } from "react-native"; +import { Header } from "react-native/Libraries/NewAppScreen"; + +export default function RootLayout() { + return ( + + + + + ); +} diff --git a/app/TripDetails.tsx b/app/(tabs)/trips/[Tripid].tsx similarity index 85% rename from app/TripDetails.tsx rename to app/(tabs)/trips/[Tripid].tsx index c5638e9..f8b3df2 100644 --- a/app/TripDetails.tsx +++ b/app/(tabs)/trips/[Tripid].tsx @@ -1,9 +1,14 @@ import { Image, StyleSheet, Text, View } from "react-native"; import React from "react"; import trips from "@/data/trips"; +import { useLocalSearchParams } from "expo-router"; const TripDetails = () => { - const trip = trips[0]; + const { Tripid } = useLocalSearchParams(); + const trip = trips.find((p) => p.id === Number(Tripid)); + console.log(Tripid); + console.log(trip); + return ( {trip?.name} diff --git a/app/(tabs)/trips/_layout.tsx b/app/(tabs)/trips/_layout.tsx new file mode 100644 index 0000000..597b3d2 --- /dev/null +++ b/app/(tabs)/trips/_layout.tsx @@ -0,0 +1,9 @@ +import { StyleSheet, Text, View } from "react-native"; +import React from "react"; +import { Stack } from "expo-router"; + +export const TripsLayout = () => { + return ; +}; + +const styles = StyleSheet.create({}); diff --git a/app/_layout.tsx b/app/_layout.tsx index a0bfe6f..5691782 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -1,9 +1,16 @@ -import { Stack } from "expo-router"; +import { StyleSheet, Text, View } from "react-native"; +import React from "react"; +import { Tabs } from "expo-router"; -export default function RootLayout() { - return ; -} - -export const unstable_settings = { - initialRouteName: "index", +const RootLayout = () => { + return ( + + + + + ); }; + +export default RootLayout; + +const styles = StyleSheet.create({}); diff --git a/component/TripCard.tsx b/component/TripCard.tsx index 4f7d841..2a766a8 100644 --- a/component/TripCard.tsx +++ b/component/TripCard.tsx @@ -1,5 +1,6 @@ import { Image, StyleSheet, Text, View } from "react-native"; import React from "react"; +import { Link, useLocalSearchParams } from "expo-router"; interface TripCardProps { trip: { @@ -17,9 +18,11 @@ interface TripCardProps { const TripCard = ({ trip }: TripCardProps) => { return ( - - - + + + + + ); }; diff --git a/tsconfig.json b/tsconfig.json index 909e901..33db939 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,15 +3,9 @@ "compilerOptions": { "strict": true, "paths": { - "@/*": [ - "./*" - ] - } + "@/*": ["./*"] + }, + "jsx": "react-native" }, - "include": [ - "**/*.ts", - "**/*.tsx", - ".expo/types/**/*.ts", - "expo-env.d.ts" - ] + "include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"] }