diff --git a/app/Nav.tsx b/app/Nav.tsx
new file mode 100644
index 0000000..3877efc
--- /dev/null
+++ b/app/Nav.tsx
@@ -0,0 +1,54 @@
+import {Appbar, Portal, Button, Dialog, Menu, Text, useTheme} from "react-native-paper";
+import {Image, StyleSheet, View} from "react-native";
+import React, {useState} from "react";
+
+const styles = StyleSheet.create({
+ logoContainer: { flex: 1, alignItems: "center" },
+ logo: { width: 150, height: 75, resizeMode: "contain" },
+});
+
+const Nav = ({ toggleProfile }: { toggleProfile: () => void; }) => {
+ const theme = useTheme();
+ const [aboutVisible, setAboutVisible] = useState(false);
+ const [menuVisible, setMenuVisible] = useState(false);
+ const [menuAnchor, setMenuAnchor] = useState<{ x: number; y: number } | null>(null);
+
+ return (
+
+
+
+
+ {
+ setMenuAnchor({ x: event.nativeEvent.pageX, y: event.nativeEvent.pageY + 40 });
+ setMenuVisible(true);
+ }}
+ iconColor={theme.colors.inversePrimary} />
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default Nav;
diff --git a/app/StatusPage.tsx b/app/StatusPage.tsx
index d27e9d3..d8fd215 100644
--- a/app/StatusPage.tsx
+++ b/app/StatusPage.tsx
@@ -1,8 +1,8 @@
import React, { useEffect, useState } from "react";
import useWebSocket from "react-use-websocket";
import axios from "axios";
-import { Image, StyleSheet, View } from "react-native";
-import { Appbar, Avatar, Button, List, useTheme, Dialog, Portal, Text, Menu } from "react-native-paper";
+import { StyleSheet, View } from "react-native";
+import { Avatar, List, Button, useTheme, } from "react-native-paper";
interface Message {
Id: string;
@@ -14,8 +14,6 @@ interface Message {
const styles = StyleSheet.create({
container: { flex: 1, alignItems: "stretch" },
- logoContainer: { flex: 1, alignItems: "center" },
- logo: { width: 150, height: 75, resizeMode: "contain" },
listContainer: { flex: 1, width: "100%" },
listSubheader: {
fontSize: 18, // Larger text
@@ -53,16 +51,13 @@ const styles = StyleSheet.create({
},
});
-const StatusPage = ({ toggleProfile, id, name, image, isProfileActive }: { toggleProfile: () => void; id: string; name: string; image: string; isProfileActive: boolean }) => {
+const StatusPage = ({ id, name, image, isProfileActive }: { id: string; name: string; image: string; isProfileActive: boolean }) => {
const theme = useTheme();
const [messages, setMessages] = useState([]);
const { lastMessage } = useWebSocket("ws://localhost:8080/ws", {
shouldReconnect: () => true,
});
- const [aboutVisible, setAboutVisible] = useState(false);
- const [menuVisible, setMenuVisible] = useState(false);
- const [menuAnchor, setMenuAnchor] = useState<{ x: number; y: number } | null>(null);
useEffect(() => {
if (lastMessage?.data) {
@@ -91,35 +86,6 @@ const StatusPage = ({ toggleProfile, id, name, image, isProfileActive }: { toggl
return (
-
-
-
- {
- setMenuAnchor({ x: event.nativeEvent.pageX, y: event.nativeEvent.pageY + 40 });
- setMenuVisible(true);
- }}
- iconColor={theme.colors.inversePrimary}
- />
-
-
-
-
-
-
@@ -170,21 +136,6 @@ const StatusPage = ({ toggleProfile, id, name, image, isProfileActive }: { toggl
style={[styles.actionButton, { backgroundColor: theme.colors.primary }]}
labelStyle={{ color: theme.colors.onPrimary }} >Arrived
-
-
-
diff --git a/app/index.tsx b/app/index.tsx
index 28d93e8..27bbed9 100644
--- a/app/index.tsx
+++ b/app/index.tsx
@@ -5,8 +5,7 @@ import { v4 as uuidv4 } from "uuid";
import AsyncStorage from "@react-native-async-storage/async-storage";
import ProfileScreen from "@/app/ProfileScreen";
import StatusPage from "@/app/StatusPage";
-
-
+import Nav from "@/app/Nav";
const Index = () => {
const { colors } = useTheme();
@@ -55,8 +54,11 @@ const Index = () => {
return (
- setProfileActive(true)}
+ isProfileActive={isProfileActive}
+ />
+