u
This commit is contained in:
1 parent
f59d5c4f59
commit
b1348343c9
24 files changed
+1691
-1243
No files matched your search
@@ -0,0 +1,50 @@
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { Slot, useRouter } from "expo-router";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import Navbar from "@/components/layout/navbar";
|
||||
|
||||
interface ModuleLayoutProps {
|
||||
title?: string;
|
||||
titleIcon?: any;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
export default function PageLayout({ title, titleIcon, children }: ModuleLayoutProps) {
|
||||
const router = useRouter();
|
||||
const insets = useSafeAreaInsets();
|
||||
|
||||
function handleBack() {
|
||||
router.back();
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
router.navigate("/(tabs)/home");
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1 }}>
|
||||
<View style={{ flex: 1 }}>{children ?? <Slot />}</View>
|
||||
|
||||
<View
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
zIndex: 10,
|
||||
}}
|
||||
>
|
||||
<View style={{ paddingTop: insets.top }}>
|
||||
<Navbar
|
||||
title={title}
|
||||
titleIcon={titleIcon}
|
||||
showBack={true}
|
||||
onBack={handleBack}
|
||||
onClose={handleClose}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user