From 1cbfa7eba8d8d5fb951dbafff10fa1e557f18a08 Mon Sep 17 00:00:00 2001 From: Cyber Majeed <73933962+cybermajeed@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:39:43 +0400 Subject: [PATCH] Add files via upload --- mobile/App.js | 10 ++-- mobile/app.json | 10 +--- mobile/app/dashboard.js | 28 ++++++++++ mobile/app/login.js | 112 ++++++++++++++++++++++++++++++++++++++++ mobile/style.js | 103 ++++++++++++++++++++++++++++++++++++ 5 files changed, 250 insertions(+), 13 deletions(-) create mode 100644 mobile/app/dashboard.js create mode 100644 mobile/app/login.js create mode 100644 mobile/style.js diff --git a/mobile/App.js b/mobile/App.js index 2409154..5509ab5 100644 --- a/mobile/App.js +++ b/mobile/App.js @@ -1,5 +1,5 @@ -import loginPage from "./login"; -import userPage from "./user"; +import userLogin from "./app/login"; +import userDashboard from "./app/dashboard"; import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; const Stack = createNativeStackNavigator(); @@ -17,12 +17,12 @@ export default function App() { diff --git a/mobile/app.json b/mobile/app.json index bfdbdea..85e7ccf 100644 --- a/mobile/app.json +++ b/mobile/app.json @@ -21,16 +21,10 @@ "adaptiveIcon": { "foregroundImage": "./assets/logo.png", "backgroundColor": "#ffffff" - }, - "package": "com.cybermajeed.Notifire" + } }, "web": { "favicon": "./assets/logo.png" - }, - "extra": { - "eas": { - "projectId": "768915cc-8129-4740-b178-fe5d9651326d" - } } } -} +} \ No newline at end of file diff --git a/mobile/app/dashboard.js b/mobile/app/dashboard.js new file mode 100644 index 0000000..aa3e592 --- /dev/null +++ b/mobile/app/dashboard.js @@ -0,0 +1,28 @@ +import { SafeAreaView, Button, Text } from "react-native"; +import { styles } from "../style"; +import { auth, signOut, onAuthStateChanged } from "../auth"; +import { useState } from "react"; +export default function App({ navigation }) { + const [name, setName] = useState(""); + onAuthStateChanged(auth, (user) => { + if (user) { + const name = user.email.split("@")[0]; + setName(name); + } + }); + const LogoutUser = () => { + signOut(auth) + .then(() => { + console.log("signed out"); + }) + .catch((error) => { + console.log(error); + }); + }; + return ( + + Hello {name} +