Path based routing for index
This commit is contained in:
parent
581d28a6df
commit
9921da7265
10 changed files with 358 additions and 324 deletions
28
app/components/navigation/TaskNavigationBar.tsx
Normal file
28
app/components/navigation/TaskNavigationBar.tsx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { router, useGlobalSearchParams } from "expo-router";
|
||||
import type { NativeStackHeaderProps } from "@react-navigation/native-stack";
|
||||
import { Appbar } from "react-native-paper";
|
||||
import { getHeaderTitle } from "@react-navigation/elements";
|
||||
|
||||
export default function TaskNavigationBar({
|
||||
options,
|
||||
route,
|
||||
}: NativeStackHeaderProps) {
|
||||
const { taskId, taskName } = useGlobalSearchParams<{
|
||||
taskId: string;
|
||||
taskName?: string;
|
||||
}>();
|
||||
const title = getHeaderTitle(options, taskName || route.name);
|
||||
|
||||
return (
|
||||
<Appbar.Header elevated>
|
||||
<Appbar.BackAction
|
||||
onPress={() =>
|
||||
router.canGoBack() ? router.back() : router.replace("/")
|
||||
}
|
||||
/>
|
||||
<Appbar.Content title={title} />
|
||||
{/*<Appbar.Action icon="run-fast" onPress={() => {}} />*/}
|
||||
{/*<Appbar.Action icon="square-edit-outline" onPress={() => {}} />*/}
|
||||
</Appbar.Header>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue