From c4e009dd732fb7a3604c72b93f835bf32a886df4 Mon Sep 17 00:00:00 2001 From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com> Date: Sun, 12 May 2024 13:01:51 +0900 Subject: [PATCH 1/9] =?UTF-8?q?merge=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/app/(tabs)/profile.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/front/src/app/(tabs)/profile.tsx b/front/src/app/(tabs)/profile.tsx index eaa51329..694c25e3 100644 --- a/front/src/app/(tabs)/profile.tsx +++ b/front/src/app/(tabs)/profile.tsx @@ -13,6 +13,7 @@ const image = { uri: "https://legacy.reactjs.org/logo-og.png" }; const Profile = (): JSX.Element => { // sample console.log(useAuthContext()); + const user = useAuthContext(); return ( @@ -21,7 +22,7 @@ const Profile = (): JSX.Element => { Name: - Michael + {user?.displayName} Sex: From 042ebcb61130c8362d7de1da9c18818870b3acc3 Mon Sep 17 00:00:00 2001 From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com> Date: Sun, 26 May 2024 13:00:33 +0900 Subject: [PATCH 2/9] =?UTF-8?q?profile.txt=E3=81=A7=E3=80=81=E8=87=AA?= =?UTF-8?q?=E5=88=86=E3=81=AE=E5=90=8D=E5=89=8D=E3=81=A8userID=E3=82=92?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/app/(tabs)/profile.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/front/src/app/(tabs)/profile.tsx b/front/src/app/(tabs)/profile.tsx index 694c25e3..51939585 100644 --- a/front/src/app/(tabs)/profile.tsx +++ b/front/src/app/(tabs)/profile.tsx @@ -14,6 +14,7 @@ const Profile = (): JSX.Element => { // sample console.log(useAuthContext()); const user = useAuthContext(); + return ( @@ -22,11 +23,11 @@ const Profile = (): JSX.Element => { Name: - {user?.displayName} + {user?.name} - Sex: - Male + ID: + {user?.id} Sample: From fcee9935d3a4f40fd835f62832a8d7a9336223a7 Mon Sep 17 00:00:00 2001 From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com> Date: Sun, 26 May 2024 13:03:26 +0900 Subject: [PATCH 3/9] =?UTF-8?q?fetch=E3=81=AE=E6=99=82=E3=81=AE=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=AE=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/app/(tabs)/followRequestList.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/front/src/app/(tabs)/followRequestList.tsx b/front/src/app/(tabs)/followRequestList.tsx index ccda4a01..b9343409 100644 --- a/front/src/app/(tabs)/followRequestList.tsx +++ b/front/src/app/(tabs)/followRequestList.tsx @@ -25,6 +25,17 @@ fetch("http://localhost:3000/requests/" + currentUserId.toString(), { .then((data) => { console.log("success: fetching matchRequests"); matchRequests = data; + }) + .catch((error) => { + // Handle Errors here. + // const errorCode = error.code; + // const errorMessage = error.message; + // The email of the user's account used. + // const email = error.customData.email; + // The AuthCredential type that was used. + // const credential = GoogleAuthProvider.credentialFromError(error); + // ... + console.error(error); }); const List = (): JSX.Element => { From 944d2afc8eee880f881c7680a12c1d9c7b5dbf0b Mon Sep 17 00:00:00 2001 From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com> Date: Sun, 26 May 2024 13:04:04 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=E3=81=84=E3=82=89=E3=81=AA=E3=81=84?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/app/(tabs)/profile.tsx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/front/src/app/(tabs)/profile.tsx b/front/src/app/(tabs)/profile.tsx index 51939585..c906ae6f 100644 --- a/front/src/app/(tabs)/profile.tsx +++ b/front/src/app/(tabs)/profile.tsx @@ -49,18 +49,7 @@ const Profile = (): JSX.Element => { Sample: Sample Text - - Sample: - Sample Text - - - Sample: - Sample Text - - - Sample: - Sample Text - + ); From c05df499e2b069ca121218c105419bfe06c1522e Mon Sep 17 00:00:00 2001 From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com> Date: Sun, 26 May 2024 14:41:16 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/app/(tabs)/login.tsx | 22 +++++++++++++++++++--- front/src/app/(tabs)/profile.tsx | 1 - 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/front/src/app/(tabs)/login.tsx b/front/src/app/(tabs)/login.tsx index 702348dd..eee2489d 100644 --- a/front/src/app/(tabs)/login.tsx +++ b/front/src/app/(tabs)/login.tsx @@ -1,11 +1,11 @@ -import { GoogleAuthProvider, signInWithPopup } from "firebase/auth"; +import { GoogleAuthProvider, signInWithPopup ,signOut} from "firebase/auth"; import { View, Text, StyleSheet } from "react-native"; import Button from "../../components/Button"; import { auth } from "../../firebase/firebaseconfig"; const provider = new GoogleAuthProvider(); -const handlePress = (): void => { +const signIn = (): void => { signInWithPopup(auth, provider) .then((result) => { // This gives you a Google Access Token. You can use it to access the Google API. @@ -31,6 +31,15 @@ const handlePress = (): void => { console.error(error); }); }; +const signOutUser = (): void => { + signOut(auth) + .then(() => { + console.log('サインアウトしました'); + }) + .catch((error) => { + console.error('サインアウトエラー: ', error); + }); +}; const LogIn = (): JSX.Element => { return ( @@ -40,7 +49,13 @@ const LogIn = (): JSX.Element => {