Add liquid search & jobs list.

This commit is contained in:
Patrick Fic
2025-10-08 12:53:58 -07:00
parent 091606f1ca
commit 820da94a9f
8 changed files with 208 additions and 27 deletions

View File

@@ -1,6 +1,10 @@
import { Stack } from "expo-router";
import { Stack, useLocalSearchParams, useRouter } from "expo-router";
function JobsStack() {
const router = useRouter();
const params = useLocalSearchParams();
console.log("*** ~ JobsStack ~ params:", params);
return (
<Stack
screenOptions={{
@@ -9,8 +13,27 @@ function JobsStack() {
},
}}
>
<Stack.Screen name="index" options={{ title: "Active Jobs" }} />
<Stack.Screen name="[jobId]" options={{ title: "Job Details" }} />
<Stack.Screen
name="index"
options={{
title: "Search",
headerSearchBarOptions: {
placement: "automatic",
placeholder: "Search",
onChangeText: (event) => {
router.setParams({
search: event?.nativeEvent?.text,
});
},
},
}}
/>
<Stack.Screen
name="[jobId]"
options={({ route }) => ({
title: (route.params as any)?.title || "Job Details",
})}
/>
</Stack>
);
}

View File

@@ -1,24 +1,4 @@
import { Link } from "expo-router";
import { StyleSheet, Text, View } from "react-native";
import JobsList from "../../components/jobs-list/jobs-list";
export default function Tab() {
return (
<View style={styles.container}>
<Text>Jobs Screen.</Text>
<Link
href={{ pathname: "/jobs/[jobId]", params: { jobId: 123 } }}
withAnchor
>
Go to detail
</Link>
</View>
);
return <JobsList />;
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
},
});