Compare commits
No commits in common. "e4ee0ba82756dbbe1424abbe1083dcb1603dfaff" and "2b995758620fabd4dd645f26c951a62b8914d202" have entirely different histories.
e4ee0ba827
...
2b99575862
@ -1,7 +1,7 @@
|
|||||||
import {Appbar, Portal, Button, Dialog, Menu, Text, useTheme} from "react-native-paper";
|
import {Appbar, Portal, Button, Dialog, Menu, Text, useTheme} from "react-native-paper";
|
||||||
import {Image, useColorScheme, View} from "react-native";
|
import {Image, useColorScheme, View} from "react-native";
|
||||||
import React, {useState} from "react";
|
import React, {useState} from "react";
|
||||||
import styles from "@/assets/styles";
|
import styles from "@/app/styles";
|
||||||
|
|
||||||
const Nav = ({ toggleProfile }: { toggleProfile: () => void; }) => {
|
const Nav = ({ toggleProfile }: { toggleProfile: () => void; }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
@ -4,8 +4,8 @@ import { Button, TextInput, Dialog, Portal, Avatar, useTheme, Text } from "react
|
|||||||
import { Asset } from 'expo-asset';
|
import { Asset } from 'expo-asset';
|
||||||
import * as FileSystem from 'expo-file-system';
|
import * as FileSystem from 'expo-file-system';
|
||||||
import * as ImagePicker from "expo-image-picker";
|
import * as ImagePicker from "expo-image-picker";
|
||||||
import themes from '@/assets/themes';
|
import themes from '@/app/themes';
|
||||||
import styles from "@/assets/styles";
|
import styles from "@/app/styles";
|
||||||
import log from "@/util/log"
|
import log from "@/util/log"
|
||||||
import featureFlags from '@/util/featureFlags';
|
import featureFlags from '@/util/featureFlags';
|
||||||
|
|
@ -3,8 +3,8 @@ import useWebSocket from "react-use-websocket";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {Animated, Easing, ImageBackground, useColorScheme, View} from "react-native";
|
import {Animated, Easing, ImageBackground, useColorScheme, View} from "react-native";
|
||||||
import { Avatar, List, Button, useTheme, } from "react-native-paper";
|
import { Avatar, List, Button, useTheme, } from "react-native-paper";
|
||||||
import themes from "@/assets/themes";
|
import themes from "@/app/themes";
|
||||||
import styles from "@/assets/styles";
|
import styles from "@/app/styles";
|
||||||
import log from "@/util/log"
|
import log from "@/util/log"
|
||||||
|
|
||||||
export const API_URL = process.env.EXPO_PUBLIC_API_URL;
|
export const API_URL = process.env.EXPO_PUBLIC_API_URL;
|
@ -6,7 +6,7 @@ import 'react-native-reanimated';
|
|||||||
import { useColorScheme } from 'react-native';
|
import { useColorScheme } from 'react-native';
|
||||||
import { PaperProvider, Provider } from "react-native-paper";
|
import { PaperProvider, Provider } from "react-native-paper";
|
||||||
import { UserProvider, useUser } from "@/context/UserContext";
|
import { UserProvider, useUser } from "@/context/UserContext";
|
||||||
import themes from '@/assets/themes'
|
import themes from '@/app/themes'
|
||||||
import log from "@/util/log"
|
import log from "@/util/log"
|
||||||
|
|
||||||
// Prevent the splash screen from auto-hiding before asset loading is complete.
|
// Prevent the splash screen from auto-hiding before asset loading is complete.
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
import { useFonts } from 'expo-font';
|
|
||||||
import { Stack } from 'expo-router';
|
|
||||||
import * as SplashScreen from 'expo-splash-screen';
|
|
||||||
import { useEffect } from 'react';
|
|
||||||
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 '@/assets/themes'
|
|
||||||
import log from "@/util/log"
|
|
||||||
|
|
||||||
// Prevent the splash screen from auto-hiding before asset loading is complete.
|
|
||||||
SplashScreen.preventAutoHideAsync();
|
|
||||||
|
|
||||||
export default function RootLayout() {
|
|
||||||
return (
|
|
||||||
<UserProvider>
|
|
||||||
<InnerRootLayout />
|
|
||||||
</UserProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function InnerRootLayout() {
|
|
||||||
const { currentTheme } = useUser(); // Access the currentTheme from UserContext
|
|
||||||
log.debug(currentTheme);
|
|
||||||
const colorScheme = useColorScheme();
|
|
||||||
log.debug(colorScheme);
|
|
||||||
const [loaded] = useFonts({
|
|
||||||
SpaceReg: require('../assets/fonts/SpaceMono-Regular.ttf'),
|
|
||||||
SpaceBold: require('../assets/fonts/SpaceMono-Bold.ttf'),
|
|
||||||
Light: require('../assets/fonts/font-light.otf'),
|
|
||||||
Medium: require('../assets/fonts/font-medium.otf'),
|
|
||||||
Heavy: require('../assets/fonts/font-heavy.otf'),
|
|
||||||
});
|
|
||||||
useEffect(() => {
|
|
||||||
if (loaded) {
|
|
||||||
SplashScreen.hideAsync();
|
|
||||||
}
|
|
||||||
}, [loaded]);
|
|
||||||
|
|
||||||
if (!loaded) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure currentTheme is treated as a valid key, or fallback to 'blue'
|
|
||||||
//const themeKey: 'blue' | 'green' | 'red' | 'yellow' | 'orange' = (currentTheme as 'blue' | 'green' | 'red' | 'yellow' | 'orange') || 'blue';
|
|
||||||
|
|
||||||
// Use the themeKey to index into the themes object
|
|
||||||
|
|
||||||
//const appTheme = themes[themeKey][colorScheme === 'dark' ? 'dark' : 'light'];
|
|
||||||
const appTheme = themes[currentTheme as keyof typeof themes][colorScheme === 'dark' ? 'dark' : 'light']
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Provider>
|
|
||||||
<PaperProvider theme={appTheme}>
|
|
||||||
<Stack>
|
|
||||||
<Stack.Screen name="index" options={{ headerShown: false }} />
|
|
||||||
</Stack>
|
|
||||||
</PaperProvider>
|
|
||||||
</Provider>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,12 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {View, Text } from "react-native";
|
import {View, Text } from "react-native";
|
||||||
import { useTheme } from "react-native-paper";
|
import { useTheme } from "react-native-paper";
|
||||||
import ProfileScreen from "@/components/ProfileScreen";
|
import ProfileScreen from "@/app/ProfileScreen";
|
||||||
import StatusPage from "@/components/StatusPage";
|
import StatusPage from "@/app/StatusPage";
|
||||||
import Nav from "@/components/Nav";
|
import Nav from "@/app/Nav";
|
||||||
import BottomNav from "@/components/BottomNav"
|
|
||||||
import { useUser } from "@/context/UserContext";
|
import { useUser } from "@/context/UserContext";
|
||||||
import styles from "@/assets/styles";
|
import styles from "@/app/styles";
|
||||||
import log from "@/util/log"
|
import log from "@/util/log"
|
||||||
|
|
||||||
const Index = () => {
|
const Index = () => {
|
||||||
@ -63,7 +62,6 @@ const Index = () => {
|
|||||||
setChanged={setUserDataChanged}
|
setChanged={setUserDataChanged}
|
||||||
onClose={() => setProfileActive(false)}
|
onClose={() => setProfileActive(false)}
|
||||||
/>
|
/>
|
||||||
<BottomNav />
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
import {Appbar, Button, Text, useTheme} from "react-native-paper";
|
|
||||||
import {View} from "react-native";
|
|
||||||
import styles from "@/assets/styles";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const BottomNav = () => {
|
|
||||||
const theme = useTheme();
|
|
||||||
return (
|
|
||||||
<View style={{ backgroundColor: theme.colors.background }}>
|
|
||||||
<Appbar.Header style={{ backgroundColor: theme.colors.primaryContainer, height: 38 }}>
|
|
||||||
<View style={{ alignItems: "center", flexDirection: "row", justifyContent: "space-between", padding: 10, flex: 1, paddingHorizontal: 15 }}>
|
|
||||||
<Text style={{ color: theme.colors.primary, fontFamily: "Light" }}>Daisy Knight Dog Park</Text>
|
|
||||||
<Button
|
|
||||||
mode="text"
|
|
||||||
onPress={() => null}
|
|
||||||
style={{ backgroundColor: theme.colors.primary, height: 38/2, justifyContent: "center"}}
|
|
||||||
labelStyle={{ color: theme.colors.onPrimary, fontFamily: "Light"}}>
|
|
||||||
Change
|
|
||||||
</Button>
|
|
||||||
</View>
|
|
||||||
</Appbar.Header>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default BottomNav;
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.2 KiB |
@ -1,2 +0,0 @@
|
|||||||
User-agent: *
|
|
||||||
Disallow: /
|
|
Loading…
Reference in New Issue
Block a user