Move components out of app, add BottomNav

This commit is contained in:
whysman 2025-03-08 17:49:48 -05:00
parent 2b99575862
commit 8178179ac2
8 changed files with 31 additions and 10 deletions

View File

@ -6,7 +6,7 @@ import 'react-native-reanimated';
import { useColorScheme } from 'react-native';
import { PaperProvider, Provider } from "react-native-paper";
import { UserProvider, useUser } from "@/context/UserContext";
import themes from '@/app/themes'
import themes from '@/assets/themes'
import log from "@/util/log"
// Prevent the splash screen from auto-hiding before asset loading is complete.

View File

@ -1,11 +1,12 @@
import React from 'react';
import {View, Text } from "react-native";
import { useTheme } from "react-native-paper";
import ProfileScreen from "@/app/ProfileScreen";
import StatusPage from "@/app/StatusPage";
import Nav from "@/app/Nav";
import ProfileScreen from "@/components/ProfileScreen";
import StatusPage from "@/components/StatusPage";
import Nav from "@/components/Nav";
import BottomNav from "@/components/BottomNav"
import { useUser } from "@/context/UserContext";
import styles from "@/app/styles";
import styles from "@/assets/styles";
import log from "@/util/log"
const Index = () => {
@ -62,6 +63,7 @@ const Index = () => {
setChanged={setUserDataChanged}
onClose={() => setProfileActive(false)}
/>
<BottomNav />
</View>
);
};

19
components/BottomNav.tsx Normal file
View File

@ -0,0 +1,19 @@
import {Appbar, Portal, Button, Dialog, Menu, Text, useTheme} from "react-native-paper";
import {Image, useColorScheme, View} from "react-native";
import styles from "@/assets/styles";
const BottomNav = () => {
const theme = useTheme();
return (
<View style={{ backgroundColor: theme.colors.background }}>
<Appbar.Header style={{ backgroundColor: theme.colors.primaryContainer, height: 38 }}>
<View style={{ alignItems: 'flex-start', flexDirection: "row", justifyContent: "space-between", padding: 10, flex: 1, paddingHorizontal: 15 }}>
<Text style={{ color: theme.colors.primary, fontFamily: "Light"}}>Daisy Knight Dog Park</Text>
<Text style={{ color: theme.colors.primary, fontFamily: "Light"}}>(change)</Text>
</View>
</Appbar.Header>
</View>
)
}
export default BottomNav;

View File

@ -1,7 +1,7 @@
import {Appbar, Portal, Button, Dialog, Menu, Text, useTheme} from "react-native-paper";
import {Image, useColorScheme, View} from "react-native";
import React, {useState} from "react";
import styles from "@/app/styles";
import styles from "@/assets/styles";
const Nav = ({ toggleProfile }: { toggleProfile: () => void; }) => {
const theme = useTheme();

View File

@ -4,8 +4,8 @@ import { Button, TextInput, Dialog, Portal, Avatar, useTheme, Text } from "react
import { Asset } from 'expo-asset';
import * as FileSystem from 'expo-file-system';
import * as ImagePicker from "expo-image-picker";
import themes from '@/app/themes';
import styles from "@/app/styles";
import themes from '@/assets/themes';
import styles from "@/assets/styles";
import log from "@/util/log"
import featureFlags from '@/util/featureFlags';

View File

@ -3,8 +3,8 @@ import useWebSocket from "react-use-websocket";
import axios from "axios";
import {Animated, Easing, ImageBackground, useColorScheme, View} from "react-native";
import { Avatar, List, Button, useTheme, } from "react-native-paper";
import themes from "@/app/themes";
import styles from "@/app/styles";
import themes from "@/assets/themes";
import styles from "@/assets/styles";
import log from "@/util/log"
export const API_URL = process.env.EXPO_PUBLIC_API_URL;