diff --git a/native_gg/App.tsx b/native_gg/App.tsx index 4f0fb930d..c9cc5c276 100644 --- a/native_gg/App.tsx +++ b/native_gg/App.tsx @@ -1,117 +1,10 @@ -import { StatusBar } from "expo-status-bar"; -import { Button, ScrollView, StyleSheet, Text, View } from "react-native"; -import { SafeAreaProvider, SafeAreaView, initialWindowMetrics } from "react-native-safe-area-context"; -import { Image } from "expo-image"; -import { LinearGradient } from "expo-linear-gradient"; -import { useEffect, useReducer, useRef } from "react"; -import AuthUI from "./src/authentication/AuthUI.tsx"; import { clientID } from "./src/constants/env.ts"; -import AuthService from "./src/authentication/AuthService.ts"; -import { authReducer, initialAuthState } from "./src/state/Actions.ts"; -import { getItemDefinition, getProfileTest, saveItemDefinition } from "./src/backend/api.ts"; -import StorageGG from "./src/storage/StorageGG.ts"; +import Director from "./src/views/Director.tsx"; export default function App() { if (process.env.NODE_ENV === "development" && clientID === undefined) { console.warn("No .ENV file found. Please create one."); } - const storeRef = useRef(StorageGG.getInstance()); - const authServiceRef = useRef(null); - const [state, dispatch] = useReducer(authReducer, initialAuthState); - - const accountAvatar = state.initComplete - ? state.currentAccount - ? `https://www.bungie.net${state.currentAccount?.iconPath}` - : "https://d33wubrfki0l68.cloudfront.net/554c3b0e09cf167f0281fda839a5433f2040b349/ecfc9/img/header_logo.svg" - : ""; - - useEffect(() => { - authServiceRef.current = AuthService.getInstance(); - authServiceRef.current.subscribe(dispatch); - // Unsubscribe when the component unmounts - return () => { - if (authServiceRef.current) { - authServiceRef.current.cleanup(); - } - authServiceRef.current = null; - }; - }, []); - - return ( - - - - - - - Guardian Ghost - - - - - - { - AuthService.startAuth(); - }} - processURL={(url) => { - AuthService.processURL(url); - }} - /> - - Membership ID: - {state.currentAccount?.supplementalDisplayName} - - - Authenticated: {state.authenticated ? "True" : "False"} - - -